XChart icon indicating copy to clipboard operation
XChart copied to clipboard

How to Add Multiple series to a Donut Chart (Multiple Rings)

Open prateekag opened this issue 6 years ago • 6 comments

Today, If I want to create a donut chart, I need to do this: PieChart chart = new PieChartBuilder().width(800).height(600).title("Pie Chart with Donut Style").build(); chart.getStyler().setDefaultSeriesRenderStyle(PieSeriesRenderStyle.Donut); chart.addSeries("A", 22); chart.addSeries("B", 10); chart.addSeries("C", 34); chart.addSeries("D", 22); chart.addSeries("E", 29); chart.addSeries("F", 40); So, the sections are named as series here. I want to create a donut chart with multiple rings in it each representing a different series of data. Is there a way to achieve this? If not can I request support for this new feature.

prateekag avatar Jun 26 '18 13:06 prateekag

@timmolter What needs to be done?

Can this issue provide suggestions?

Mr14huashao avatar Mar 23 '20 06:03 Mr14huashao

It could be like multiple y-axis groups like in line charts where you specify the donut ring index...

timmolter avatar Mar 23 '20 08:03 timmolter

@Mr14huashao What do you think? Could you implement this using an "axis Index"?

timmolter avatar Jul 20 '20 15:07 timmolter

@timmolter No original effect picture, not sure what to make it look like.

Mr14huashao avatar Jul 21 '20 01:07 Mr14huashao

example doughnut chart

timmolter avatar Jul 21 '20 09:07 timmolter

option = { angleAxis: { show: false, max: 10 }, radiusAxis: { show: false, type: 'category', data: ['AAA', 'BBB', 'CCC', 'DDD', 'E', 'F'] }, polar: {}, series: [ { type: 'bar', data: [3, 4, 5, 6, 7, 1], colorBy: 'data', roundCap: true, label: { show: true, // Try changing it to 'insideStart' position: 'start', formatter: '{b}' }, coordinateSystem: 'polar' } ] };

sainagesh555 avatar Jul 09 '22 07:07 sainagesh555