Highcharts drilldown and combining chart type

后端 未结 1 1407
灰色年华
灰色年华 2020-12-12 07:40

I would like to mix on my drilldown chart (in the children chart) column and spline like here : https://jsfiddle.net/lostrailler/Ljotp059/

But when I\'m trying, I ha

1条回答
  •  有刺的猬
    2020-12-12 08:14

    You can use drilldown event callback function for add new series as your drilldown: http://api.highcharts.com/highcharts#chart.events.drilldown

    drilldown: function(e) {
      var chart = this,
        drilldowns = chart.userOptions.drilldown.series,
        series = [];
      e.preventDefault();
      Highcharts.each(drilldowns, function(p, i) {
        if (p.id.includes(e.point.name)) {
          chart.addSingleSeriesAsDrilldown(e.point, p);
        }
      });
      chart.applyDrilldown();
    }
    

    You can use addSingleSeriesAsDrilldown(), method similar to: http://api.highcharts.com/highcharts#Chart.addSeriesAsDrilldown

    But you can add multiple series as drilldown with this method.

    Here you can see an example how it can work:

    http://jsfiddle.net/h5xjp8h5/12/

    Kind regards.

    0 讨论(0)
提交回复
热议问题