hamza saber
hamza saber

Reputation: 569

Highcharts network graph custom link labels

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

Upvotes: 0

Views: 997

Answers (1)

ppotaczek
ppotaczek

Reputation: 39099

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

Upvotes: 1

Related Questions