How to make Highchart 2 or more inner Pie but only 1 outer pie with donut type?

StackOverflow https://stackoverflow.com/questions/14052931

  •  12-12-2021
  •  | 
  •  

سؤال

I need a chart with 2 or more inner Pie Slice and 1 outer pie with donut type of Highchart plugin.

Here is the donut example :

http://tinyurl.com/d4fp8p9

Here is jsfiddle. It has categories and each category has more than 1 data. What I want ? I have categories but each category doesn't have data. There is only 1 slice that have data for outer pie.

هل كانت مفيدة؟

المحلول

Here is working Demo

Actually you need to remove drilldown attribute from the pie that has no link with donut pie and check the data with:

 if(data[i].drilldown!=undefined){
    for (var j = 0; j < data[i].drilldown.data.length; j++) {
        var brightness = 0.2 - (j /data[i].drilldown.data.length) / 5 ;
        versionsData.push({
            name: data[i].drilldown.categories[j],
            y: data[i].drilldown.data[j],
            color: Highcharts.Color(data[i].color).brighten(brightness).get()
        });
    }
}}

or put empty drilldown like this Demo

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top