Class SankeyDataNode
Represents the node data in the SfSankey component.
Inheritance
Namespace: Syncfusion.Blazor.Sankey
Assembly: Syncfusion.Blazor.dll
Syntax
public class SankeyDataNode : 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
SankeyDataNode()
Declaration
public SankeyDataNode()
Properties
Alignment
Gets or sets the alignment of the node in the SfSankey.
Declaration
public SankeyNodeAlign Alignment { get; set; }
Property Value
Type | Description |
---|---|
SankeyNodeAlign | A value from the SankeyNodeAlign enum that specifies the alignment of the node. The default value is Stretch. THe available options are: |
Remarks
Color
Gets or sets the color of the node in the SfSankey.
Declaration
public string Color { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string value that specifies the color of the node. The value can be specified in hex or rgba format. The default value is null. |
Remarks
If the Color property is not set, the node color will be automatically generated based on the Theme property.
Id
Gets or sets the unique identifier of the node.
Declaration
public string Id { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string that represents the node's unique ID. The default value is null. |
Remarks
This is a mandatory property that defines the unique identifier of the node. The value should be unique for each node in the SfSankey.
Label
Gets or sets the label for the node.
Declaration
public SankeyDataLabel Label { get; set; }
Property Value
Type | Description |
---|---|
SankeyDataLabel | A SankeyDataLabel object that defines the label displayed on the node. The default value is null. |
Remarks
This property is used to define the label displayed on the node. The SankeyDataLabel object has properties to customize the appearance of the label.
Offset
Gets or sets the horizontal / vertical offset of the node.
Declaration
public double Offset { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A double value that specifies the offset of the node. The default value is 0. |
Remarks
Set the Offset property to move the node from its default position.
Opacity
Gets or sets the opacity level of the node.
Declaration
public double Opacity { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A double value between 0.0 (fully transparent) and 1.0 (fully opaque). The default value is 1.0. |
Remarks
Padding
Gets or sets the padding inside the node.
Declaration
public double Padding { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A double value representing the padding inside the node. The default value is 10. |
Remarks
Width
Gets or sets the width of the node.
Declaration
public double Width { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A double value that specifies the width of the node. The default value is 20. |