XYLinechart -coloring for lines

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
masandeep
Posts: 5
Joined: Tue Jan 31, 2006 5:54 pm

XYLinechart -coloring for lines

Post by masandeep » Wed Apr 26, 2006 4:14 pm

How to place individual colors for lines in XYLinechart



Thanx in advance

Regards,
Sandy

doudou
Posts: 27
Joined: Tue Mar 14, 2006 6:05 pm

Post by doudou » Wed Apr 26, 2006 4:49 pm

What I understand is that you wand to set the color for the whole serie... I am right?
In that case this is a method of the renderer.

example:

Code: Select all

XYItemRenderer renderer = plot.getRenderer();
renderer.setSeriesPaint(0,Color.GREEN);
renderer.setSeriesPaint(1,Color.YELLOW);
where 0 and 1 are the index of the series in your dataset

Of course you'll have to adapt to your context...

Locked