echart 桑基图操作事项

mac2022-06-30  23

例图

 

注意:

option = { label:{//formatter名字 show:true, formatter:function(obj){ return obj.data.name+'_123' } }, tooltip: { //可以自行添加,默认不添加 }, series: { type: 'sankey', layout:'none', focusNodeAdjacency: 'allEdges', data: [{ name: 'a', value:11 }, { name: 'b' }, { name: 'a1' }, { name: 'a2' }, { name: 'b1' }, { name: 'c' }], links: [{ source: 'a', target: 'a1', value: 5 }, { source: 'a', target: 'a2', value: 3 }, { source: 'b', target: 'b1', value: 8 }, { source: 'a', target: 'b1', value: 3 }, { source: 'b1', target: 'a1', value: 1 }, { source: 'b1', target: 'c', value: 2 }] } };

 注意事项:

series。data和link里面的名称不能有重复的否则会报错

 

详细参照文章 里面demo4页面

转载于:https://www.cnblogs.com/pengfei25/p/10533378.html

最新回复(0)