Highcharts网络图自定义链接标签
我正在尝试实现网络图,在我的情况下,必须标记边缘.例如,我正在获取这样的数据
i'm trying to implement a network graph, and in my case the edges must be labeld. For example, i'm fetching data like this
[{来自:"A",至:"B",标签":"text1"},{来自:"B",至:"C",标签": " text2"}]
[{from: "A", to: "B", "label":"text1"},{from: "B", to: "C", "label": "text2"}]
因此在图中它必须是这样的:A ----- text1 ------ B -------- text2 -------- C
so in the graph it must be like this: A-----text1------B--------text2--------C
我已经阅读了文档,并且有linkFormatter可以帮助我做到这一点,但我不知道.我试图模仿这个问题的答案 highchart网络network-graph ,它在工具提示上没有显示标签边缘.可以请人帮我!!
I've read the docs and there's the linkFormatter that can help me do this but i can't figure it out. I've tried to memic this question's answer highchart network network-graph that shows label on tooltip not the edges. Can please someone help me !!
使用linkFormat
或linkFormatter
并正确引用该属性,例如:
Use linkFormat
or linkFormatter
with the correct reference to the property, for example:
series: [{
...,
dataLabels: {
enabled: true,
allowOverlap: true,
linkFormat: '{point.label}'
},
}]
实时演示: https://jsfiddle.net/BlackLabel/jfbwLhp3/
API参考: https://api .highcharts.com/highcharts/series.networkgraph.dataLabels.linkFormatter