Gradient Filled Area Charts with Outline

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
raumaduth
Posts: 9
Joined: Fri Oct 19, 2007 9:13 am

Gradient Filled Area Charts with Outline

Post by raumaduth » Fri Oct 19, 2007 9:17 am

Hi,
I have successfully created an area chart. i would like the fill color to be a gradient paint. Is it possible to set the gradient paing for the fill of the area chart as you would in when doing bar graphs using the barRenderer?

Please help

Ridwaan

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 » Fri Oct 19, 2007 2:16 pm

No, although it would be a nice feature. The difficulty is in doing the transformation of the gradient paint's anchor points - with a bar it is easy, just use the top and bottom of the bar. But for an area chart, you probably want the gradient to run from the overall minimum value to the overall maximum value (for the entire series), and that's a little tricky to work out given the way that JFreeChart goes about drawing the area. Hopefully we'll get this working eventually (and patches are, of course, welcome!).
David Gilbert
JFreeChart Project Leader

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

raumaduth
Posts: 9
Joined: Fri Oct 19, 2007 9:13 am

Gradient Filled Area Charts with Outline

Post by raumaduth » Mon Oct 22, 2007 8:26 am

Hi,

If i were to actually set the paint fill for the series to be gradient from the max value to the min value any idea how to go about doing it. It is a relatively simple task of keeping track of my max and min values for a dataset but to translate them to x,y coordiantes??? is it possible to get the coordinates of a plotted point in an area chart. that way i can set the gradient fill to be horiz accross a line from max value to min value, and have it refill whenever the chart is resized??? any ideas or suggestions?

Locked