PieChart LabelGenerator problem

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
stone18x
Posts: 1
Joined: Wed Apr 15, 2015 12:51 pm
antibot: No, of course not.

PieChart LabelGenerator problem

Post by stone18x » Wed Apr 15, 2015 1:00 pm

Hey there,

I want to change the label text of a pie chart.
So I created a pie chart and set the LabelGenerator.

Code: Select all

JFreeChart chart = ChartFactory.createPieChart(title, dataset, legend, tooltips, urls);
((PiePlot) chart.getPlot()).setLabelGenerator(new StandardPieSectionLabelGenerator("{0} = {1}"));
Somehow, this code does nothing and the labels are still standard. Am I missing something or is this wrong?
I also created a theme. Maybe this is making problems?

Freechart version: 1.0.19
JRE: jdk1.6.0_45

Thank you for your answers.

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: PieChart LabelGenerator problem

Post by paradoxoff » Thu Apr 16, 2015 12:00 pm

If you assume that your theme is the source of error, then simply comment it out and check whether this is changing anything.

GabMBell
Posts: 1
Joined: Sat Apr 18, 2015 7:20 am
antibot: No, of course not.

Re: PieChart LabelGenerator problem

Post by GabMBell » Sat Apr 18, 2015 7:25 am

I use Javascript charting library called koolchart for creating various types of charts.
<Pie3DChart showDataTips="true" depth="50" paddingLeft="100" paddingTop="50" paddingRight="100" paddingBottom="50">
...
<Pie3DSeries nameField="Country" field="Export" labelPosition="inside" color="#ffffff">
...
</Pie3DSeries>
...
</Pie3DChart>
You can check out this charting solution.

Locked