3

I've been using highcharts-ng in my angularjs project. All was doing well but now I need to use some drilldowns to detail my information and it's not working using drilldown.js. I followed the example given on highcharts' drilldown tryout fiddle but it seems to don't with angular-ng. The original Highchart example doesn't work with angular-ng as you can see in my drilldown reprodution. Any ideas of what's going wrong?

Ignore this code bellow (stackoverflow wants some code in this question)

<div ng-app="myapp">
    <div ng-controller="myctrl">
        <highchart id="chart1" config="highchartsNG"></highchart>
    </div>
</div>
João Martins
  • 1,026
  • 2
  • 14
  • 35

2 Answers2

4

Just checked code - that plugin doesn't support drilldown module for Highcharts.

To allow drilldowns, edit sources, about ~104 line add drilldown property:

  // new code:
  if(config.drilldown) {
    mergedOptions.drilldown = config.drilldown;
  };      
  // old code:
  if(config.title) {
    mergedOptions.title = config.title;
  };
  if (config.subtitle) {
    mergedOptions.subtitle = config.subtitle;
  };
  if (config.credits) {
    mergedOptions.credits = config.credits;
  }
Paweł Fus
  • 44,795
  • 3
  • 61
  • 77
  • That worked, thanks! Although, the chart doesn't act like a normal type:"column", stays with dots don't know why – João Martins Mar 05 '14 at 14:26
  • You didn't set options under.. options? http://jsfiddle.net/Cp73s/197/ - you know what? That plugin is strange.. – Paweł Fus Mar 05 '14 at 15:27
  • @prawel fus, the back button does not appear even though the drill down functionality works, what could be the reason? – Sajeetharan Sep 19 '15 at 12:21
  • Hard to say, I would creat an issue on the github for that plugin - [here](https://github.com/pablojim/highcharts-ng/issues). – Paweł Fus Sep 21 '15 at 08:36
1

The plugin use extend(defaultOptions, config.options) to override the default options. For options like 'title','subtitle', it will read the properties in your config. But for options like 'drilldown', it won't.

So, you can just change the drilldown setting into config.options to make this work,and any other setting not working you can try this way first.

suwey
  • 33
  • 5