Highcharts: adding extra data to drilldown

2019-09-07 03:02发布

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条回答
小情绪 Triste *
2楼-- · 2019-09-07 03:41

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.

查看更多
登录 后发表回答