how to paint every series with GradientPaint?

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

how to paint every series with GradientPaint?

Post by wy » Mon Dec 02, 2002 4:24 pm

who can tell me how to paint every series section with GradientPaint?
I have tried below
Paint paint = new GradientPaint(0,0,Color.blue,200,200,Color.pink);
plot.setSeriesPaint(0,paint);
but it not work!

David Gilbert

Re: how to paint every series with GradientPaint?

Post by David Gilbert » Tue Dec 03, 2002 12:16 am

That should set the paint for the first series, although you might not get quite the effect you are after because of the way that the GradientPaint class uses those fixed coordinates.

If you want to modify the gradient to, say, run from one end of a bar to the other in a bar chart, you will need to modify the JFreeChart source code to take into account the drawing area for each bar.

Regards,

DG

Locked