Linear Function

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

Linear Function

Post by morpheus » Wed Feb 12, 2003 7:32 pm

Hi David,

I have to draw a linear function and draw a filled triangle on the average value.

In your opinion, what's the best way to do it? My first idea was to subclass the default renderer and swim in the java 2D API... I didn't start yet I need your confirmation :o)

Thanks

Rgards

morpheus

Re: Linear Function

Post by morpheus » Thu Feb 13, 2003 12:01 pm

Any JFreeChart Guru nearby here?

morpheus

Re: Linear Function

Post by morpheus » Fri Feb 14, 2003 10:38 am

are u here David? Need ur help....

David Gilbert

Re: Linear Function

Post by David Gilbert » Fri Feb 14, 2003 3:12 pm

I would create a second dataset containing the point that is the average value (you'll have to calculate the average with your own code). And a secondary renderer to display it as a shape only. Leave the secondary axis set to null and I'm pretty sure the primary axis will get used (didn't test it though).

Regards,

Dave Gilbert

morpheus

Re: Linear Function

Post by morpheus » Fri Feb 14, 2003 4:29 pm

Not setting the secondary Range Axis raises Null exception. I set it to the first one, the only small inconvenient i had is that the secondary range Axis is drawn the right side...

Regards
Morpheus

Locked