2


这是一个笨蛋:http:
//plnkr.co/edit/S1B9Q9e1yen0QgmKt2ri

var chartConfig = {
  title: {
    text: 'Number of offers by trend'
  },
  subtitle: {
    text: 'My company'
  },
  plotOptions: {
    series: {
      dataLabels: {
        enabled: true,
        format: '{point.name}: {point.y:.1f}%'
      }
    }
  },

  tooltip: {
    headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
    pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
  },
  options: {
    chart: {
      type: 'pie'
    },
    legend: {
      align: 'right',
      x: -70,
      verticalAlign: 'top',
      y: 20,
      floating: true,
      backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
      borderColor: '#CCC',
      borderWidth: 1,
      shadow: false
    },
    tooltip: {
      headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
      pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
    },
    plotOptions: {
      column: {
        stacking: 'normal',
        dataLabels: {
          enabled: true,
          color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white',
          style: {
            textShadow: '0 0 3px black, 0 0 3px black'
          }
        }
      }
    }
  },
  series: [{
    name: 'Trends',
    colorByPoint: true,
    data: TREND_LIST
  }],
  drilldown: {
    series: NUMBER_OF_OFFERS_BY_TREND
  }
};

馅饼被淹死了,但我无法单击以获取向下钻取馅饼

这是来自 highcharts.com 的原始小提琴,我对其进行了一些更改,以便它可以与 highcharts-ng 一起使用:
bit.ly/1kOPi7L

感谢您的帮助

4

1 回答 1

11

我终于解决了它(对不起,我不得不回答我自己的问题),感谢 Pawel Fus 的启发性评论 :)
首先我添加了向下钻取模块:

    <script src="http://code.highcharts.com/modules/drilldown.js"></script>

接下来,我按照这个答案向 highcharts-ng 库添加了一些代码:
Highcharts-ng with Drilldown

最后,我将向下钻取属性放在此处提到的选项属性下:
https ://github.com/pablojim/highcharts-ng/pull/145

这是最后的工作人员: http ://plnkr.co/edit/S1B9Q9e1yen0QgmKt2ri

于 2014-07-23T08:56:59.157 回答