Highcharts:向向下钻取添加额外数据
Highcharts: adding extra data to drilldown
据我了解,下钻数据格式是这样的:
data: [['foo1', 2], ['foo2', 3], ['foo3', 2]]
我实际上成功地向每个数组添加数据,如下所示:
data: [['foo1', 2, 111], ['foo2', 3, 222], ['foo3', 2, 333]]
但是,显示它给我带来了麻烦。据我了解,对于工具提示格式化程序,使用 this.point.name、this.point.y、this.x 或 this.percentage 访问数据。如何检索点中的额外数据?
切换到使用点对象而不是数据数组。
drilldown: {
series: [{
id: 'animals',
data: [{name: 'Cats',
y: 4,
otherValue: 100},
在格式化程序中,您的额外值将位于:
this.point.otherValue
Fiddle example.
据我了解,下钻数据格式是这样的:
data: [['foo1', 2], ['foo2', 3], ['foo3', 2]]
我实际上成功地向每个数组添加数据,如下所示:
data: [['foo1', 2, 111], ['foo2', 3, 222], ['foo3', 2, 333]]
但是,显示它给我带来了麻烦。据我了解,对于工具提示格式化程序,使用 this.point.name、this.point.y、this.x 或 this.percentage 访问数据。如何检索点中的额外数据?
切换到使用点对象而不是数据数组。
drilldown: {
series: [{
id: 'animals',
data: [{name: 'Cats',
y: 4,
otherValue: 100},
在格式化程序中,您的额外值将位于:
this.point.otherValue
Fiddle example.