Pie chart label generator

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Morwen
Posts: 26
Joined: Sat Apr 02, 2005 6:26 pm

Pie chart label generator

Post by Morwen » Sun Aug 19, 2007 4:32 pm

Hello everyone,

I wanted to point out a problem (Which should be relatively easy to fix):
While using AbstractPieItemLabelGenerator, I'm using datasets which are "filled" with null values in order to be consistent cross-charts (Its problematic currently when displaying two bar charts next to one another on the same axis).
When the dataset is displayed as a pie chart, null values are automatically displayed as "null". I was wondering if that could be modified somehow to allow the using programmer to have a bit of control over the basic logic there (As the logic is well founded, only the text needs to be changable).
One solution could be accessing an innate messages file which would render that attribute modifable by the programmer.
That would help in many other places where JFree needs to be a bit more customizable with text-related issues.

I solved the issue by setting Generators with overriden getItemsArray method, and, although I know its an ugly hack, that's the more general way I had to deal with the issue.

FYI,

Morwen.

kpbird
Posts: 3
Joined: Wed Jun 04, 2008 11:00 am

Post by kpbird » Wed Jun 04, 2008 11:15 am

have you try this

PiePlot plot = (PiePlot) chart.getPlot();
plot.setIgnoreNullValues(true);
plot.setIgnoreZeroValues(true);

Locked