Highcharts-ng with drilldown

*爱你&永不变心* 提交于 2019-12-17 20:26:29

问题


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>

回答1:


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;
  }



回答2:


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.



来源:https://stackoverflow.com/questions/22195266/highcharts-ng-with-drilldown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!