带有钻取功能的 Highcharts-ng [英] Highcharts-ng with drilldown

查看:38
本文介绍了带有钻取功能的 Highcharts-ng的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在我的 angularjs 项目中使用 highcharts-ng.一切都很好,但现在我需要使用一些向下钻取来详细说明我的信息,但它不能使用drilldown.js.我遵循了 highcharts 的下钻试用小提琴上给出的示例,但它似乎与 angular-ng 无关.原Highchart 示例 不适用于angular-ng,正如您在我的钻取再现中所见一>.对出了什么问题有任何想法吗?

忽略下面这段代码(stackoverflow 需要在这个问题中添加一些代码)

<div ng-controller="myctrl"><highchart id="chart1" config="highchartsNG"></highchart>

解决方案

刚刚检查的代码 - 该插件不支持 Highcharts 的向下钻取模块.

要允许向下钻取,编辑源,大约 ~104 行添加向下钻取属性:

//新代码:如果(配置.钻取){mergeOptions.drilldown = config.drilldown;};//旧代码:如果(配置.标题){合并选项.title = config.title;};如果(配置.字幕){合并选项.subtitle = config.subtitle;};如果(config.credits){mergeOptions.credits = config.credits;}

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>

解决方案

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

这篇关于带有钻取功能的 Highcharts-ng的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆