Mouse position -> time with segmented timeline?
-
- Posts: 8
- Joined: Tue Jul 06, 2010 4:18 pm
- antibot: No, of course not.
Mouse position -> time with segmented timeline?
I have an XYPlot using a DateAxis for the domain axis. I would like to convert mouse coordinates to the corresponding time on the x-axis. This is usually pretty simple, and can be done by getting the screen data area, finding the mouse position in relation to this area, and then calculating the time with respect to the minimum and maximum axis dates. However, I am using a segmented timeline, which skips some periods of time, so this method won't work. Is there a more direct method of finding the x-axis value from the mouse's position?
Re: Mouse position -> time with segmented timeline?
In my code I use the following
Code: Select all
double chartX = xyplot.getDomainAxis().java2DToValue(p.getX(), subplotArea, xyplot.getDomainAxisEdge());
-
- Posts: 8
- Joined: Tue Jul 06, 2010 4:18 pm
- antibot: No, of course not.
Re: Mouse position -> time with segmented timeline?
Skunk, you are awesome. Thank you.