dataset color

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
lutchanah
Posts: 5
Joined: Thu Jul 31, 2003 7:21 am

dataset color

Post by lutchanah » Thu Jul 31, 2003 7:24 am

i need some help

it's possible to change the dataset default color ?
if someboby know tell me please

Bye

yosie

Post by yosie » Thu Jul 31, 2003 8:39 am

I made a color change of series of CategoryItemRenderer in following code.

Code: Select all

CategoryItemRenderer renderer = plot.getRenderer();
Paint[] paint;?[b]// Arrangement by which the color to set up personally was defined[/b]
for(int ii=0; ii<paint.length; ii++){
??renderer.setSeriesPaint(ii, paint[ii]);
}
I am sorry if it is not the thing which you want to do.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Jul 31, 2003 12:39 pm

The colors are controlled in the renderer. The HorizontalBarChartDemo2 class (included in the JFreeChart distribution) contains code that customises the colors...
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

jsrana
Posts: 2
Joined: Fri Aug 08, 2003 4:00 pm
Location: New Jersey

Post by jsrana » Fri Aug 08, 2003 4:55 pm

Hi,

The setSeriesPaint() method sets the color of a series but how can we set the color of individual datavalues in that series, which is usually done based on a condition.

Say in a series with datavalues [2, 4, 2], the first and last values(2) are passed but the second value(4) fails and we need to show this datavalue in a different color than that of passed datavalues.

Thanks,
Jitendra Rana

Locked