Vijayalakshmi
Vijayalakshmi

Reputation: 189

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?

Upvotes: 5

Views: 9141

Answers (2)

trashgod
trashgod

Reputation: 205785

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

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

Upvotes: 9

Naved
Naved

Reputation: 4128

If you are using createPieChart3D to create Pie chart, following URL will be helpful to you.
http://www.java2s.com/Code/Java/Chart/JFreeChartPieChart3DDemo1.htm
What I know is, showing values inside is default feature of the chart. If you're unable to do so it seems that you have changed the default way.

Upvotes: 1

Related Questions