Highcharts网络图自定义链接标签 [英] Highcharts network graph custom link labels

查看:314
本文介绍了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 !!

推荐答案

使用linkFormatlinkFormatter并正确引用该属性,例如:

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

这篇关于Highcharts网络图自定义链接标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆