How to display values โ€‹โ€‹in a pie chart sector

I use JFreeChart to create pie charts. Values โ€‹โ€‹are displayed outside the pie chart sectors as labels. I want to display values โ€‹โ€‹in pie sectors. How can i achieve this. Please can someone help me?

+7
source share
2 answers

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

 PiePlot plot = (PiePlot) chart.getPlot(); plot.setSimpleLabels(true); 
+11
source

If you use createPieChart3D to create a pie chart, the following URL will be helpful. http://www.java2s.com/Code/Java/Chart/JFreeChartPieChart3DDemo1.htm
What I know shows the values โ€‹โ€‹inside - the default function of the chart. If you cannot do this, it seems that you have changed the default method.

+2
source

All Articles