Class SankeyDataLabel
Represents the label data for a node in the SfSankey component.
Inheritance
Namespace: Syncfusion.Blazor.Sankey
Assembly: Syncfusion.Blazor.dll
Syntax
public class SankeyDataLabel : Object
Examples
<SfSankeyChart Width="600px" Height="400px" DataSource="@SankeyData">
<SankeyChartNodes Width="30" Alignment="SankeyNodeAlign.Left" OffsetX="10" OffsetY="10" Padding="10">
</SankeyChartNodes>
<SankeyChartLinks Color="blue" ColorType="ColorType.Static" HighlightOpacity="1" InactiveOpacity="0.3" Opacity="0.7"> </SankeyChartLinks>
</SfSankeyChart>
@code {
public SankeyChartData SankeyData = new SankeyChartData()
{
Nodes = new List<SankeyChartDataNode>(),
Links = new List<SankeyChartDataLink>()
};
protected override void OnInitialized()
{
base.OnInitialized();
SankeyData.Nodes = new List<SankeyChartDataNode>()
{
new SankeyChartDataNode() { Id = "Female", Label = new SankeyChartDataLabel() { Text = "Female (58%)" } },
new SankeyChartDataNode() { Id = "Male", Label = new SankeyChartDataLabel() { Text = "Male (42%)" } },
new SankeyChartDataNode() { Id = "Tablet", Label = new SankeyChartDataLabel() { Text = "Tablet (12%)" } },
new SankeyChartDataNode() { Id = "Mobile", Label = new SankeyChartDataLabel() { Text = "Mobile (40%)" } },
new SankeyChartDataNode() { Id = "Desktop", Label = new SankeyChartDataLabel() { Text = "Desktop (48%)" } },
new SankeyChartDataNode() { Id = "< 18", Label = new SankeyChartDataLabel() { Text = "< 18 years (8%)" } },
new SankeyChartDataNode() { Id = "18-26", Label = new SankeyChartDataLabel() { Text = "18-26 years (35%)" } },
new SankeyChartDataNode() { Id = "27-40", Label = new SankeyChartDataLabel() { Text = "27-40 years (38%)" } },
new SankeyChartDataNode() { Id = "> 40", Label = new SankeyChartDataLabel() { Text = "> 40 years (19%)" } }
};
SankeyData.Links = new List<SankeyChartDataLink>()
{
new SankeyChartDataLink() { SourceId = "Female", TargetId = "Tablet", Value = 12 },
new SankeyChartDataLink() { SourceId = "Female", TargetId = "Mobile", Value = 14 },
new SankeyChartDataLink() { SourceId = "Female", TargetId = "Desktop", Value = 32 },
new SankeyChartDataLink() { SourceId = "Male", TargetId = "Mobile", Value = 26 },
new SankeyChartDataLink() { SourceId = "Male", TargetId = "Desktop", Value = 16 },
new SankeyChartDataLink() { SourceId = "Tablet", TargetId = "< 18", Value = 4 },
new SankeyChartDataLink() { SourceId = "Tablet", TargetId = "> 40", Value = 8 },
new SankeyChartDataLink() { SourceId = "Mobile", TargetId = "< 18", Value = 4 },
new SankeyChartDataLink() { SourceId = "Mobile", TargetId = "18-26", Value = 24 },
new SankeyChartDataLink() { SourceId = "Mobile", TargetId = "27-40", Value = 10 },
new SankeyChartDataLink() { SourceId = "Mobile", TargetId = "> 40", Value = 2 },
new SankeyChartDataLink() { SourceId = "Desktop", TargetId = "18-26", Value = 11 },
new SankeyChartDataLink() { SourceId = "Desktop", TargetId = "27-40", Value = 28 },
new SankeyChartDataLink() { SourceId = "Desktop", TargetId = "> 40", Value = 9 }
};
}
}
Constructors
SankeyDataLabel()
Declaration
public SankeyDataLabel()
Properties
Color
Gets or sets the color of the label text.
Declaration
public string Color { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string value that specifies the color of the text. The default value is null. |
Remarks
The value can be specified in hex or rgba format, following valid CSS color string conventions.
FontFamily
Gets or sets the font family for the label text.
Declaration
public string FontFamily { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string that specifies the font family used for the label. |
FontSize
Gets or sets the font size of the label text.
Declaration
public double FontSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A double value representing the size of the font. |
FontStyle
Gets or sets the font style of the label text.
Declaration
public string FontStyle { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string value that specifies the style of the font (e.g., italic). |
FontWeight
Gets or sets the font weight of the label text.
Declaration
public string FontWeight { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string value representing the font weight (e.g., bold). |
Padding
Gets or sets the padding inside the label.
Declaration
public double Padding { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A double value representing the padding around the label text. |
Text
Gets or sets the label text.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string value that represents the content of the label. |
Visible
Gets or sets a value indicating whether the label is visible.
Declaration
public bool Visible { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | A boolean value indicating the visibility of the label. |