Data Binding
You can bind the Sankey diagram to data by using the component's data
input. This attribute requires your data to match the SankeyData
format. However, if your data has a different format, you must process and structure it before feeding it to the component.
Binding to SankeyData
The following example demonstrates how to set the data
property to data with the SankeyData
format. The data is located in the data.ts
file.
Binding to Flat Data
When the data is present as an array of objects, it needs to be transformed to the SankeyData
format.
This can be achieved by using the kendoSankeyFlatBinding
directive as in the example below.
Customize Nodes from Flat Data
In this case, if you want to customize the element instances, you will need to do this in the dataBound
event handler. The event arguments contain the nodes and links that you can access using e.data.nodes
and e.data.links
.