DxSankey.Data Property
Specifies an object that supplies Sankey data.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public IEnumerable<object> Data { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<Object> | A data source. |
Remarks
Use the Data
property to bind the Sankey component to an IEnumerable<T> data source. Follow the steps below to display data within the component:
- Bind the
Data
parameter to a C# field or property. - Populate this field or property with data in the OnInitialized lifecycle method.
The <DxSankey>
component displays data source values as nodes that have weights. Source and target nodes are connected with links that illustrate the weight flow between nodes.
To create nodes and links, specify the Sankey component’s SourceFieldName, TargetFieldName, and WeightFieldName properties.
<DxSankey Data="@Data"
Width="100%"
Height="440px"
SourceFieldName="Source"
TargetFieldName="Target"
WeightFieldName="Weight">
<DxSankeyNodeSettings Width="8" Spacing="30" />
<DxSankeyLinkSettings ColorMode="SankeyLinkColorMode.Gradient" />
<DxTitleSettings Text="Commodity Turnover" />
</DxSankey>
@code {
IEnumerable<SankeyDataPoint> Data = Enumerable.Empty<SankeyDataPoint>();
protected override void OnInitialized() {
Data = GenerateData();
}
}
See Also