我有一个包含多级下钻的图表。
给定系列ID我想使用像
这样的函数向下钻取function drilldown(id) {
// function drills down to the series having id
}
是否可以这样做?
答案 0 :(得分:4)
您可以像这样手动触发事件:
chart.series[0].points[0].hcEvents.click[0]();
答案 1 :(得分:0)
是否可以这样做?
是
这是示例代码
chartConfig.chart.events.drilldown = function(e) {
if (!e.seriesOptions) {
var chart = this,
drilldowns = drillDownColumChartData,
drilldowns2 = drillDownLinChartData,
columnSeries = drilldowns[e.point.drilldown],
lineSeries = drilldowns2[e.point.drilldown];
setTimeout(function() {
/*https://github.com/highcharts/highcharts/issues/2989*/
if (e.point.x != null) {
chart.addSingleSeriesAsDrilldown(e.point, columnSeries);
chart.addSingleSeriesAsDrilldown(e.point, lineSeries);
chart.yAxis[1].setTitle({
text: secondaryYaxisTitle
})
chart.applyDrilldown();
}
}, 0);
}
};
您可以从e.point