Bar Chart color

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

Bar Chart color

Post by torpedo » Thu Aug 16, 2001 10:23 am

I use jfreechart draw a bar chart, i want to change the bar color
because the first bar is red ,second is blue,..... i want the first
is blue, the second is green.....i don't find any method can do this
do anyone can give me some advice?? Thanks a lot!

David Gilbert

RE: Bar Chart color

Post by David Gilbert » Sat Aug 18, 2001 7:43 pm

Hi,

You can use the setSeriesPaint(...) method in the JFreeChart class. Just provide an array of Paint objects - the array can be any size, if there are more series than Paint objects, JFreeChart will cycle through them again from the beginning.

Regards,

DG.

Locked