Hi,
I'd like to thank you guys for a great product.
I have two problems:
1- when I put the mouse on a point in the XY chart I get a tool Tip which shows the X Y coordinates. I am dealing with very small numbers (up to 10 decimal places) and Jfreechart seems to round these numbers in the tool tip and hence I always get x:0 , y:0 .
How can I increase the precision of these numbers in the tool tip?
How do I decrease the time taken to show the tool tip (i.e. I'd like it instantly)?
2- I am using XY chart and I would like to get the coordinates of a point when I click on it as well as the corresponding XY series number (or name).
I will then uses these coordinates to perform another procedure.
Thank you in advance
Jonny
XYchart tooltip and Mouseevent
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: XYchart tooltip and Mouseevent
Use this constructor for the StandardXYToolTipGenerator:jonnycolt74 wrote:1- when I put the mouse on a point in the XY chart I get a tool Tip which shows the X Y coordinates. I am dealing with very small numbers (up to 10 decimal places) and Jfreechart seems to round these numbers in the tool tip and hence I always get x:0 , y:0 .
How can I increase the precision of these numbers in the tool tip?
How do I decrease the time taken to show the tool tip (i.e. I'd like it instantly)?
Code: Select all
public StandardXYToolTipGenerator(NumberFormat xFormat, NumberFormat yFormat);
You need to write a class that implements the ChartMouseListener interface, then add the listener to the ChartPanel class. The ChartMouseEvent will return the information you require.jonnycolt74 wrote:2- I am using XY chart and I would like to get the coordinates of a point when I click on it as well as the corresponding XY series number (or name).
I will then uses these coordinates to perform another procedure.
Regards,
Dave Gilbert