how to give different colours

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

how to give different colours

Post by bhaskar » Wed Jan 29, 2003 3:22 pm

Hi,
i have created a vertical bar chart with 2 categories but, a single set of data. I get same color to all categories because, the set is same. How do i get different colors?

David Gilbert

Re: how to give different colours

Post by David Gilbert » Thu Jan 30, 2003 12:48 am

You can use the setCategoriesPaint(...) method in the renderer (inherited from the AbstractCategoryItemRenderer class. When the paint array is non-null, and there is only one series, the renderer cycles through the paint array to get the color for each item in the series.

Regards,

Dave Gilbert

Doug Fenger

Re: how to give different colours

Post by Doug Fenger » Tue Feb 04, 2003 1:05 am

I'm able to give different category colors for a vertical bar chart, but it doesn't seem to work for vertical statistical bar charts. Is there a way to have different category colors using VerticalStatisticalBarRenderer?

Narasimha Narahari

Re: how to give different colours

Post by Narasimha Narahari » Tue Feb 04, 2003 10:53 pm

Hi,
I am not able to understand how to use this setCategoriesPaint(.. ). Could someone give me an example.

Thanks,
--Narasimha

Locked