SceneElement Class

An element of a ChartScene.

public abstract class SceneElement

Properties

NameDescription
CssClassGets or sets the CSS class of the element in the SVG output.
DataAttributesGets the data-* attributes of the element in the SVG output, by name without the data- prefix. Scripts of a web page read them with element.dataset. Set them with SceneElement.SetDataAttribute.
OpacityGets or sets the opacity of the element, from 0 to 1.
TooltipGets or sets the text shown when hovering the element (an SVG title).

Gets or sets the CSS class of the element in the SVG output.

public string? CssClass { get; set; }

Property value

string?

DataAttributes

SceneElement.cs

Gets the data-* attributes of the element in the SVG output, by name without the data- prefix. Scripts of a web page read them with element.dataset. Set them with SceneElement.SetDataAttribute.

public IReadOnlyDictionary<string, string> DataAttributes { get; }

Gets or sets the opacity of the element, from 0 to 1.

public double Opacity { get; set; }

Property value

double

Gets or sets the text shown when hovering the element (an SVG title).

public string? Tooltip { get; set; }

Property value

string?

Methods

NameDescription
SetDataAttribute(string, string?)Sets a data-* attribute of the element in the SVG output, or removes it.

SetDataAttribute(string, string?)

SceneElement.cs

Sets a data-* attribute of the element in the SVG output, or removes it.

public void SetDataAttribute(string name, string? value)

Parameters

name string
The name of the attribute without the data- prefix: lowercase ASCII letters, digits, hyphens, underscores and dots.
value string?
The value, or null to remove the attribute.

Exceptions

ArgumentException
name is empty or contains another character.