2014-07-22 84 views
2


這裏有一個plunker:
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

Th幫助

+0

是否highcharts-ng的支持drilldown.js插件? (順便說一句,包括drilldown.js文件 - 它缺少) - 我可以看到你已經創建了它的github [ticket](https://github.com/pablojim/highcharts-ng/issues/159)。 –

+0

我做了,它支持,您的評論幫助了很多, 謝謝 – Fourat

+0

哦,對了,我完全忘記了這個問題:http://stackoverflow.com/questions/22195266/highcharts-ng-with-drilldown –

回答

10

anks我終於解決了它(抱歉,我不得不回答我的問題),這要歸功於帕維爾畢淑敏的啓發評論:)
首先,我添加了鑽取模塊:

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

下一頁我遵循這個答案,並添加一些代碼到highcharts-NG lib目錄下:
Highcharts-ng with drilldown

最後我把鑽取屬性選項屬性下這裏提到:
https://github.com/pablojim/highcharts-ng/pull/145

下面是最終woorking plunker:
http://plnkr.co/edit/S1B9Q9e1yen0QgmKt2ri

+0

不要忘記接受你的答案 - 這是點左邊的綠色標記。恭喜! –

+0

您不應該需要對插件進行任何編輯:http://plnkr.co/edit/CsvZGI3rEAjGHg9TdhqM?p=preview – Pablojim