JoefsMaggie opened a new issue #8445: 桑基图边和节点文字模板是否可以是不同的 URL: https://github.com/apache/incubator-echarts/issues/8445 <!-- 为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。 --> ### One-line summary [问题简述] 桑基图的边的value决定了节点的宽度,所以只能传数值,但是边的模板(tooltip.formatter)只能使用a/b/c,也就是说不能使用比例,查看官方资料,自己也试着尝试过,边是没有模板的,而节点和option都有模板,但是节点的模板权重比option的高,会覆盖option的模板,导致节点和边都使用了节点的模板,所以有没有什么方式可以解决这个问题? 我不知道我使用的方式是否有错,希望指正!谢谢各位大佬们! ### Version & Environment [版本及环境] + ECharts version [ECharts 版本]:4 + Browser version [浏览器类型和版本]:Chrome + OS Version [操作系统类型和版本]:Win10 ### Expected behaviour [期望结果] link和node的formatter可以做不同展示,同时可以支持百分比,尤其是link上,提供百分比的展示挺重要的 ### ECharts option [ECharts配置项] <!-- Copy and paste your 'echarts option' here. --> <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing] --> ```javascript option = { title: { text: '桑基图' }, tooltip: { trigger: 'item', triggerOn: 'mousemove', formatter: "{b} <br/>比例:{c} {d} %" }, series: [{ type: 'sankey', layout: 'none', data: [{ name: 'a', value: '数量:' + 10 + ' \n 流量比例:' + 100 + '%', tooltip: { trigger: 'item', formatter: "{b} <br/>{c}" }, }, { name: 'b', value: '数量:' + 1 + ' \n 流量比例:' + 10 + '%', tooltip: { trigger: 'item', formatter: "{b} <br/>{c}" }, }, { name: 'c', value: '数量:' + 9 + ' \n 流量比例:' + 90 + '%', tooltip: { trigger: 'item', formatter: "{b} <br/>{c}" }, }], links: [{ source: 'a', target: 'b', value: 10 },{ source: 'a', target: 'c', value: 90 }], itemStyle: { normal: { borderWidth: 1, borderColor: '#aaa' } }, lineStyle: { normal: { curveness: 0.5 } } }] } ``` ### Other comments [其他信息] <!-- For example: Screenshot or Online demo --> <!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
