I have read the forum archives on this topic, but I'm still too dense to figure this out. I have an XYPlot and I'd like to highlight the XYSeries upon mouseover.
I achieved this rather easily by registering a ChartMouseListener, casting to XYChartEntity, and getting the series index, which could then by used to call:
chart.getXYPlot().getRenderer().setSeriesStroke(seriesIndex,...)
However, I'd like to take this to the next step and highlight these series when particular XYTextAnnotations are moused over. I can detect the XYAnnotationEntity fine, but the class seems to contain insufficient information for me to determine which XYAnnotation was moused over. Any advice would be greatly appreciated...
Thanks!
Yet another 'mouseover-highlighting' question :)
-
- Posts: 21
- Joined: Sat Jan 05, 2008 2:14 am
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
That does look like a limitation. Maybe a solution would be to add an 'id' field to all annotations, and include this in the entity. I'll have to think some more about that (no time now, unfortunately).
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 21
- Joined: Sat Jan 05, 2008 2:14 am
-
- Posts: 844
- Joined: Fri Oct 13, 2006 9:29 pm
- Location: Sunnyvale, CA
I actually use this approach for content sensitive popup menus. I store the dataset, series, and item number in a comma-separated url string. That provides me all the information I need to lookup and content sensitive data from a map or other storage class.gribas wrote:What about using the 'url' field to store some control information, like the series the annotation belongs to ?
Richard West
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA