Coloring bar issue.

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
meehaw
Posts: 10
Joined: Wed Aug 08, 2007 9:16 am

Coloring bar issue.

Post by meehaw » Tue Mar 11, 2008 1:14 pm

Hello,

I'm playing with Drools (JBossRules). Im trying to change a color of a bar in a bar chart basing on some rules.

Changing color by overwriting a getItemPaint method from Bar renderer is not a problem, I can set any color. But this is not what i want to have.

However I would like to call a method which will change a color of particular bar item. To have such functionality:

Code: Select all

plot.getRenderer.setItemPaint(int row, int column)
For example if user types:

Code: Select all

when 
x>5
then
barColor(red)
then each bar with value>5 would be red...

You will say that i can code it inside getItemPaint... but then if user types:

Code: Select all

when 
x<5 and -4<x
then
  when 
barColor(red)
then I will have to change source code again... this is not an option, thats why having something like:

Code: Select all

plot.getRenderer.setItemPaint(int row, int column)
would be a great thing.

Is there any posibility to achieve such functionality?

Locked