AbstractCategoryItemRenderer && setCategoriesPaint d

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

AbstractCategoryItemRenderer && setCategoriesPaint d

Post by Jose Miguel » Fri Oct 04, 2002 10:10 am

I'm trying change colors of lines and I do this:
AbstractCategoryItemRenderer renderer2 = (AbstractCategoryItemRenderer)((VerticalCategoryPlot)plot).getRenderer();
// set the color for each category...

renderer2.setCategoriesPaint(new Paint[] { Color.orange, Color.blue, Color.green,
Color.yellow, Color.orange, Color.cyan,
Color.magenta, Color.blue });

But when I write chart to a file first serie isn´t orange.

What can I do?

David Gilbert

Re: AbstractCategoryItemRenderer && setCategoriesPai

Post by David Gilbert » Fri Oct 04, 2002 10:39 am

You should use setSeriesPaint(...) in the Plot class.

The setCategoriesPaint(...) method is for a special case where there is only one series. Lots of people asked for a way to color each bar differently for the one series, and this was the way I did it.

Regards,

DG.

Locked