stacked Donut
Hello,
is it correct, that it's currently not possible to stack pie or donut charts into each other?
Best regards Dominic
I'm wondering the same thing. It would be nice to stack donut charts.
What do you mean "stack"?
I mean concentric donut charts and assume the same for pie charts.
@masayuki0812 I`m looking for this feature too. Basicly "stacked" pie (donut) chart is something that looks like hierarchical partition in d3.js, look at sunburst example http://bl.ocks.org/kerryrodden/7090426 ; Or multi level pie chart example is http://ecomfe.github.io/echarts/doc/example/pie.html#-en
As I understand for now in c3.js algoritm for creating pie chart looks like: we have some series:
data: {
columns: [
['data1', 30, 170],
['data2', 120, 80],
],
type : 'pie',
}
// than its done reducing for each seria, smth like this:
dataReduced = data.columns.map(d3.sum());
totalCount = d3.sum(data_reduced);
dataForEachArc = dataReduced/ totalCount;
//after this we have dataForEachArc == {'data1': 0.5, 'data2': 0.5}
//then we draw pie based on dataForEachArc
For the "stacked" pie chart, I think we should draw another "level" based on not reduced data
dataForEachArcInSubLevel_data1 = data.columns['data1'] / totalCount
//same for data2
So we will get dataForEachArcInSubLevel_data1 == [30/400, 170/400] == [0.075, 0.425] Then we draw 4 more arcs with higher radius based on dataForEachArcInSubLevel_data1 and dataForEachArcInSubLevel_data2 At the end start angle of data1 should be equals to start angle of 0.075 valued arc, end angle of data1 equals to end angle of 0.425 valued arc. Finally we will get something like this:

Also it would be perfect, if it will be there axis.type=category support for labeling this pieces of data
+1 Old issue but that would be super awesome
Might be related to #1133
duplicate with #1133