问题
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