Class SankeyData
Represents the SfSankey component DataSource type.
Inheritance
System.Object
SankeyData
Namespace: Syncfusion.Blazor.Sankey
Assembly: Syncfusion.Blazor.dll
Syntax
public class SankeyData : Object
Examples
<SfSankeyChart Width="600px" Height="400px" DataSource="@SankeyData">
<SankeyChartNodes Width="30" Alignment="SankeyNodeAlign.Left" Offset="10" Padding="10">
</SankeyChartNodes>
<SankeyChartLinks Color="blue" ColorType="ColorType.Source" 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
SankeyData()
Declaration
public SankeyData()
Properties
Links
Gets or sets the collection of SankeyDataLink objects to the SfSankey.
Declaration
public List<SankeyDataLink> Links { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<SankeyDataLink> | Accepts the collection of SankeyDataLink objects. The default value is null. |
Remarks
Nodes
Gets or sets the collection of SankeyDataNode objects to the SfSankey.
Declaration
public List<SankeyDataNode> Nodes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<SankeyDataNode> | Accepts the collection of SankeyDataNode objects. The default value is null. |