1

I have several time series plotted with jfreechart. The graph also contains multiple annotations. I want the user to be able to select the time series or the annotations.

So far I have tried: entityCollection.getEntity(x,y) which returns me the PlotEntity and panel.getComponentAt(x,y) which gives me the chart panel.

so my question is: can jFreechart provide me with this information?

bdecaf
  • 4,652
  • 23
  • 44

1 Answers1

3

You can add a ChartMouseListener, as shown here. The ChartMouseEvent will indicate which ChartEntity subclass was found.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • 1
    Since I also plan to implement mouseDragged I can't use it directly, but using your pointer I could find my mistake quickly. Problem was I had to correct the mouse coordinates - and I found the code in ChartPanel.java – bdecaf Jan 18 '12 at 11:00