草庐IT

javascript - Highcharts : Adding Hyperlinks to the X-Axis of the chart

coder 2023-08-03 原文

我一直在我的 PHP 网站中使用 HighCharts,方法是从旧图表迁移它,我对该库的图表选项和函数的数量印象深刻。

但是我无法提供指向 x 轴(或 y 轴)值的超链接以导航到另一个 URI。

本例中的类别代码

xAxis: {
    categories: [
        'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
    ]
},

任何人都可以指出 Highcharts 上的示例或文档(如果可用)。

谢谢

编辑:回答

这是链接类别名称的 jsfiddle:http://jsfiddle.net/a5Bdt/

最佳答案

我已经有一段时间没有使用 highcharts 了,但我相信您只需要提供一个 formatter功能。例如:

xAxis: {
    categories: [
        'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
    ],
    labels: {
        formatter: function () {
            return '<a>' + this.value + '</a>'
        },
        useHTML: true
    }
},

关于javascript - Highcharts : Adding Hyperlinks to the X-Axis of the chart,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13782758/

有关javascript - Highcharts : Adding Hyperlinks to the X-Axis of the chart的更多相关文章

随机推荐