React Sankey - Array Only
To bind the Sankey to an array, pass this array to the dataSource property. The array should contain objects with the source
, target
, and weight
fields (default names). You can use the sourceField, targetField, and weightField properties to specify other names:
App.vue
- <template>
- <DxSankey
- :data-source="sankeyData"
- source-field="from"
- target-field="to"
- />
- </template>
- <script>
- import DxSankey from 'devextreme-vue/sankey';
- export default {
- components: {
- DxSankey
- },
- data() {
- return {
- sankeyData: [
- { from: "Brazil", to: "Spain", weight: 4 },
- { from: "Brazil", to: "Portugal", weight: 5 },
- { from: "Brazil", to: "England", weight: 2 },
- { from: "Canada", to: "Portugal", weight: 2 },
- { from: "Canada", to: "England", weight: 1 },
- { from: "Mexico", to: "Portugal", weight: 9 },
- { from: "Mexico", to: "Spain", weight: 5 }
- ]
- }
- }
- }
- </script>
See Also
Feel free to share topic-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!
If you have technical questions, please create a support ticket in the DevExpress Support Center.