hi,
i would like to create a mouseOver-Effect which behaves likes this:
when the mouse enters my overlaid-area-plot, a vertical line shall be drawn at the position of the mouse
(i already found out, that this can be done via chartPanel.setHorizontalAxisTrace(true) )
AND
the current dataset-values of the plot at the point of the mouse-position should be displayed in detail below the plot.
how can i get access to the data dependent on the mouse-coordinates?
has anyone done something like this before?
or is there already a built-in feature of jfreechart which does this?
(i found nothing in the documentation so far )
thx for any help,
mathias
Dataset-Values for MouseOver-Effect
-
- Posts: 25
- Joined: Fri Mar 14, 2003 2:21 pm
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Take a look at the way the getToolTipText(...) method in the ChartPanel class works to find the ChartEntity under the mouse pointer. In your own code, you could do the same thing, but check to see if the ChartEntity is an 'instanceof' XYItemEntity. If it is, you can query the series index and the item index. From there, you can get the data value straight from the dataset, and display it wherever you want it.
Regards,
Dave Gilbert
Regards,
Dave Gilbert