Vijayalakshmi Vijayalakshmi - 9 days ago 5
Java Question

How to display values within pie chart sector

I am using

JFreeChart
to create pie charts. Values are displayed outside pie chart sectors as labels. I want to display the values within the pie sectors. How can I achieve this. Please can any one help me?

Answer

Use setSimpleLabels(), as shown below; org.jfree.chart.demo.PieChartDemo1 is a good starting point.

PiePlot plot = (PiePlot) chart.getPlot();
plot.setSimpleLabels(true);