A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
H. Zeiner


Post by H. Zeiner » Sat Jul 15, 2000 9:08 pm

Hello David,

I have another question to your JFreeChart Library.
How can I extend the number of colours in 1 series. If
I have 17 bars in one series, it seems that only 8 colors
are available.

Thanks, Herwig

David Gilbert

RE: Colours?

Post by David Gilbert » Sun Jul 16, 2000 12:13 pm

Hi Herwig,

The series colors are defined in the JFreeChart class itself, in an array of Paint objects. In the JFreeChart constructor, I set the array up with 8 colors, but you can change this easily by calling the setSeriesPaint() method and providing your own array of Paint objects. It doesn't matter how many colors in your array because the getSeriesPaint() method just cycles through the array and goes back to the beginning again if necessary.

Hope this helps,


Post Reply