How to gwt hold of the Graphics2D object and plotArea Object

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

How to gwt hold of the Graphics2D object and plotArea Object

Post by Chandresh Juthani » Mon Feb 18, 2002 11:07 pm

David,

I am trying to plot thre cross hairs on a JFreeChart externally i.e. not by clicking. I set the values of the crosshair and then try to draw the lines by the drawHorizontalLines() and the drawVerticalLines() method in the XYPLot. However for doing that I need the Graphics2D object and the plotArea object.

It will be nice if you can suggest me a way out of this.

Thanks
--Chandresh

David Gilbert

Re: How to gwt hold of the Graphics2D object and plotArea Ob

Post by David Gilbert » Tue Feb 19, 2002 9:29 am

Hi Chandresh,

Another developer added a facility to XYPlot to add horizontal and vertical lines as markers. You can add as many lines as you want, with the methods:

XYPlot.addHorizontalLine(...)
XYPlot.addVerticalLine(...)

The plot will take care of drawing these lines whenever the chart is redrawn.

The crosshairs are coded separately.

Regards,

DG.

Chandresh Juthani

Re: How to gwt hold of the Graphics2D object and plotArea Ob

Post by Chandresh Juthani » Tue Feb 19, 2002 7:57 pm

David,

Thanks for that..

However I need to take the control of the scatter plot outside of the click of the scatter plot. However when I try to do this with the help of adding a changeListener, there is a stack overflow Error because adding the horizontal line and the vertical line in turn call the notifyListeners() and hence there is an infinite loop being formed.

If there is anything, that you can help me with , that will be very nice of you.

Hope to get a reply from you soon.
--Chandresh

Locked