problem with setSeriesPaint and VerticalCategoryPlot

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Stacey

problem with setSeriesPaint and VerticalCategoryPlot

Post by Stacey » Thu Dec 05, 2002 7:48 pm

Has anyone else experienced problems with setSeriesPaint using the VerticalCategoryPlot (for a bar graph)?

The problem I am having:
I have 2 data series, one has data the other has null data.
The color from the null series ends up being the visible color drawn and the color of the next series (the one with data) is not visible.

I do not have this problem when I use setSeriesPaint on the same data using XYPlot (for a line graph).

I've stepped through the code and the color's that I assign to each series are the colors that are associated with the correct series when I debug them. It just seems as though the plot drawing doesn't understand the null part...or something anyways....I guess if I knew what exactly was going on behind the scenes I wouldn't be posting!

Thanks for your time.
Stacey

David Gilbert

Re: problem with setSeriesPaint and VerticalCategoryPlot

Post by David Gilbert » Fri Dec 06, 2002 12:02 am

Hi Stacey,

Can you post some more details? The version of JFreeChart, the code you use to create the dataset, and the code you use to set the series paint.

There shouldn't be much that can go wrong, but I'm happy to investigate...

Regards,

DG

Stacey

Re: problem with setSeriesPaint and VerticalCategoryPlot

Post by Stacey » Mon Dec 09, 2002 5:31 pm

I don't know if my code will help or overload the message so I tried with a demo you supplied.

(LineChartrDemo1.java)
I tried the function: (aprox line 140)

plot.setSeriesPaint(new Paint[] { Color.cyan, Color.orange, Color.pink});

and the demo came up with series colored as red, green, blue.

I have come to the conclusion the seriesPaint is not working for more than just the category series like I previously thought.

Any ideas?
Again, I am using the latest from CVS as of today.
Thanks again!
Stacey

Stacey

Re: problem with setSeriesPaint and VerticalCategoryPlot

Post by Stacey » Mon Dec 09, 2002 10:23 pm

I believe I've determined my problem. There seems to be some new functionality of a PaintTable being added. I had missed this in the updates but now have found it. I was able to get all of my XYItemRenderer to use the assigned series color using the setFillPaintTable function instead of setSeriesPaint. (It seems as though these are changes being made for the implementation of dual axis support).

I still had a problem using the CategoryItemRender. I had to add the function
public void setFillPaintTable(com.jrefinery.chart.PaintTable table);

to the interface in order to get category type items to be able to also have a paintTable. I'm sure this is just something that has not been checked in yet. Thought it may be useful info for anyone who works with the CVS head.

Thanks,
Stacey

David Gilbert

Re: problem with setSeriesPaint and VerticalCategoryPlot

Post by David Gilbert » Mon Dec 09, 2002 10:55 pm

Hi Stacey,

You are correct. The CVS code is in a bit of a "halfway" state at present, I checked in the lookup tables for the series colors without removing the old setSeriesPaint(...) methods. It is all part of the dual axis code.

Right now I am working on a new release of JFreeReport (for the end of this week), but I will get back to JFreeChart and tidy it up soon...

Regards,

DG

Locked