Highcharts: adding extra data to drilldown

假装没事ソ 提交于 2019-12-12 01:56:06

问题


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

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?


回答1:


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

Fiddle example.



来源:https://stackoverflow.com/questions/27892923/highcharts-adding-extra-data-to-drilldown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!