Highcharts network graph custom link labels

隐身守侯 提交于 2020-06-29 04:45:47

问题


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

[{from: "A", to: "B", "label":"text1"},{from: "B", to: "C", "label": "text2"}]

so in the graph it must be like this: A-----text1------B--------text2--------C

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 !!


回答1:


Use linkFormat or linkFormatter with the correct reference to the property, for example:

    series: [{
        ...,
        dataLabels: {
            enabled: true,
            allowOverlap: true,
            linkFormat: '{point.label}'
        },
    }]

Live demo: https://jsfiddle.net/BlackLabel/jfbwLhp3/

API Reference: https://api.highcharts.com/highcharts/series.networkgraph.dataLabels.linkFormatter



来源:https://stackoverflow.com/questions/62493387/highcharts-network-graph-custom-link-labels

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!