This problem may have been noted in bug 1400442, but it
was closed in 1.0.1 and I am still seeing inconsistency.
I use PiePlot#setIgnoreZeroValues(true). Zero values
are correctly excluded from the chart and legend.
However, the color in the chart and legend for the same
category is different. (Example: "warning" category is
zero and excluded from chart and legend; "error"
category is non-zero and included, but colored red in
the chart and yellow in the legend. The intended color
for the "warning" category is yellow and for the
"error" category is red.)
Logged In: YES
user_id=1423398
After looking at open bugs a little closer, I think this
problem may be referenced by bug 1190647 as well.
Logged In: YES
user_id=112975
Do you get this problem with the PiePlot class, or only with
MultiplePiePlot? There is a problem with the setLimit()
implementation in MultiplePiePlot (as noted in bug 1190647),
but I can't reproduce the problem you have described with
setIgnoreZeroValues() in PiePlot. If it is possible, could
you post a small demo app that reproduces the problem?
Logged In: YES
user_id=1423398
I have carefully reviewed this and attempted to build a
small class that will demonstrate the issue. The problem as
I describe it is no longer found in JFreeChart 1.0.1.
However, I do have two other issues to raise based on the
current behavior:
1) Under JFreeChart 1.0, if a CategoryDataset item had the
value 0, it would not appear on the chart or legend (using
setIgnoreZeroValues(true)), but the DrawingSupplier would be
advanced. This would keep color choices in line with the
categories for which I intended them. Now, using JFreeChart
1.0.1, if a category has a zero value, it is not displayed
on the chart or legend and the DrawingSupplier is not
advanced, so colors get out of alignment. I am attaching a
demo class that shows this. This behavior caused me to
discover my second issue.
2) I have been using a static DrawingSupplier. In my real
app, I create many charts before exiting. It appears that
the DrawingSupplier is remembering its current position and
is not reset between charts. There is no method to reset
the supplier so it starts at the beginning on the interface.
For now I will be switching to using a local
DrawingSupplier; I suppose I could clone my static version
each time I want to create a new chart.