HighCharts:将超链接添加到图表的X轴 [英] HighCharts : Adding Hyperlinks to the X-Axis of the chart

查看:104
本文介绍了HighCharts:将超链接添加到图表的X轴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在通过从较旧的图表中迁移HighCharts在我的PHP网站中使用该库,并且该库的图形选项和函数数量给我留下了深刻的印象.

I have been using HighCharts in my PHP website by migrating it from older charts and I am very impressed by the number of graph options and functions with this library.

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

However I am not able provide hyperlinks to the values of the x-axis(or y-axis) in order to navigate to another URI.

在这种情况下的类别代码

Code of Categories in this case

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

如果可以的话,有人可以给我指出有关Highcharts的示例或文档.

Can anyone point me to an example or documentation on Highcharts if available.

谢谢

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

Here is the jsfiddle for linked category names: http://jsfiddle.net/a5Bdt/

推荐答案

自从我在highcharts中完成工作以来已经有一段时间了,但是我相信您只需要提供一个

It's been a while since I've done work in highcharts, but I believe you just need to provide a formatter function. For example:

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

这篇关于HighCharts:将超链接添加到图表的X轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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