echarts icon indicating copy to clipboard operation
echarts copied to clipboard

echarts3 桑基图 节点位子随机

Open Bimbaloo opened this issue 9 years ago • 0 comments

One-line summary [问题简述]

在桑基图里面,节点间上下位子随机。同一组数据(连接方式相同)会有不同的显示效果。

问题

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: echarts3
  • Browser version [浏览器类型和版本]: chrome 版本 58.0.3029.81 (64 位)
  • OS Version [操作系统类型和版本]: win10 专业版

Expected behaviour [期望结果]

对每个节点的位子可以的位子可以自定义

ECharts option [ECharts配置项]

option = {
            title: {
                show: false,
                text: 'Sankey Diagram'
            },
            tooltip: {
                trigger: 'item',
                triggerOn: 'mousemove',
                formatter: function (e) {
                    return e.name + ': ' + e.value + '%'
                }
            },
            series: [{
                type: 'sankey',
                layout: 'none',
                nodeWidth: '50',
                label: {
                    normal: {
                        show: true,
                        position: 'insideLeft',
                        formatter: function (e) {
                            var str = e.data.name + '\n' + e.data.aaa;
                            return str;
                        }
                    }
                },
                data: [{
                        name: '生产',
                        aaa: '60万头',
                    }, {
                        name: '供本市',
                        aaa: '30万头',
                    }, {
                        name: '外销',
                        aaa: '30万头',
                    }, {
                        name: '消费',
                        aaa: '30万头',
                    }
                ],
                links: [{
                    source: '生产',
                    target: '供本市',
                    value: 70
                }, {
                    source: '生产',
                    target: '外销',
                    value: 30
                }, {
                    source: '供本市',
                    target: '消费',
                    value: 70
                }, {
                    source: '外销',
                    target: '消费',
                    value: 30
                }],
                lineStyle: {
                    normal: {
                        color: 'source',
                        curveness: 0.5
                    }
                }
            }]
        }

Other comments [其他信息]

jsbin地址:

http://js.jirengu.com/bimur/1/edit

Bimbaloo avatar Jul 04 '17 15:07 Bimbaloo