我在桑基图中有一个用例,任何时候都只有两个级别。
参考这个 js 小提琴链接 -
https://jsfiddle.net/saurabh_netomi/92xcLuta/15/
tooltip: {
nodeFormatter:
}
我想将节点的名称移到外面,不与连接两个节点的路径重叠。
请帮我解决这个问题
我尝试了 dataLabels 属性,但它不起作用
如果将
nodes.datalabels.useHTML
设置为 true,则可以使用 nodes.datalabels.format
适当地设置元素样式,以便它们移动和对齐。但是,为了让它们有足够的空间,您必须适当设置图表的左右边距(chart.marginLeft
,chart.marginRight
)。
演示:https://jsfiddle.net/BlackLabel/mar9fkgs/
API:https://api.highcharts.com/highcharts/series.sankey.nodes.dataLabels.format
https://api.highcharts.com/highcharts/series.sankey.nodes.dataLabels.useHTML
https://api.highcharts.com/highcharts/chart.marginLeft