echart 桑基图操作事项

例图

 

注意:

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页面

posted @ 2019-03-14 20:50  人在路途  阅读(3038)  评论(0编辑  收藏  举报