How to get actual plot location on click?
How to get actual plot location on click?
I need to be able to get the plot coordinates when the user right clicks on the plot. It seems pretty easy to get the coordinates for the nearest point, but is there an way to get the click location?
Re: How to get actual plot location on click?
How did you get the nearest point?
Re: How to get actual plot location on click?
You can get the nearest point by using plot.getDomainCrosshairValue() and plot.getRangeCrosshairValue().
Re: How to get actual plot location on click?
haha.... I thought you weren't using crosshairs...
If you are using crosshair, then just set the the crosshair not to lock on data points for both domain and range and you will get the exact location of the point clicked.
http://www.jfree.org/jfreechart/api/jav ... a(boolean)

If you are using crosshair, then just set the the crosshair not to lock on data points for both domain and range and you will get the exact location of the point clicked.
http://www.jfree.org/jfreechart/api/jav ... a(boolean)
Re: How to get actual plot location on click?
that seem to easy, and what if i have several curves, lets say 5 to 10 curves, how do i get the nearest point in each curve?