knowm / XChart

XChart is a light-weight Java library for plotting data.
http://knowm.org/open-source/xchart
Apache License 2.0
1.5k stars 397 forks source link

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

Open prateekag opened 6 years ago

prateekag commented 6 years ago

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.

Mr14huashao commented 4 years ago

@timmolter What needs to be done?

Can this issue provide suggestions?

timmolter commented 4 years ago

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

timmolter commented 4 years ago

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

Mr14huashao commented 4 years ago

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

timmolter commented 4 years ago

example doughnut chart

sainagesh555 commented 2 years ago

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' } ] };