高图:向钻取中添加额外的数据 [英] Highcharts: adding extra data to drilldown

查看:146
本文介绍了高图:向钻取中添加额外的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我了解,向下钻取数据格式如下:

as i understand it, the drilldown data format is something like this:

data: [['foo1', 2], ['foo2', 3], ['foo3', 2]]

我实际上成功地将数据添加到每个数组中,如下所示:

i was actually successful in adding data to each array like so:

 data: [['foo1', 2, 111], ['foo2', 3, 222], ['foo3', 2, 333]]

但是,显示它给我带来麻烦.据我了解,对于工具提示格式化程序,使用this.point.name,this.point.y,this.x或this.percentage访问数据.那该如何去获取额外的数据呢?

but, displaying it is giving me trouble. as i understand it, for the tooltip formatter, data is accessed using this.point.name, this.point.y, this.x, or this.percentage. how does one go about retrieving extra data in the point?

推荐答案

切换为使用点对象而不是数据数组.

Switch to using a point object instead of an array for the data.

    drilldown: {
        series: [{
            id: 'animals',
            data: [{name: 'Cats',
                    y: 4, 
                    otherValue: 100},

在格式化程序中,您的附加值将为:

In the formatter your extra value will be under:

this.point.otherValue

小提琴示例.

这篇关于高图:向钻取中添加额外的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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