Show annotations on demand

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
chrisrhyno2003
Posts: 30
Joined: Thu Jun 18, 2015 5:42 pm
antibot: No, of course not.

Show annotations on demand

Post by chrisrhyno2003 » Tue Jul 07, 2015 2:29 am

I am making a dynamic XY chart.

I wanted a feature such that when the user clicks a specific data point the annotation be displayed. I don't know if annotations can be retrieved on demand based on the user's request. Is it possible ?

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Show annotations on demand

Post by paradoxoff » Tue Jul 07, 2015 9:15 pm

Have a look at the ChartMouseListener interface. In a suitable implementation, you could for example whether the clicked entity is an instance of XYItemEntity, if so get its corodinates, and then create a suitable annotation at these coordinates.

Locked