PDA

View Full Version : Contextual Menus in Charts



johnz45
11 Jan 2012, 7:37 PM
I'm currently experiencing problems implementing contextual menus for charts. Since charts do not inherit from Component, there is no setContextualMenu exposed. I have attempted to use the SeriesSelectionHandler to draw a popup with a menu underneath the mouse but ran into the a few problems:

1. I can not get the x,y coordinates of the click from the SeriesSelectionEvent.
2. I can not differentiate between right and left clicks.

If I override the onMouseDown method, I can get the x,y coordinate but would not be able to retrieve the index of the series clicked.

Does anyone have any suggestions implementing contextual menus in the new charts?

BrendanC
12 Jan 2012, 3:09 PM
Thanks, I had not taken this use case into account. Chart events will now store the originating DOM event, which should provide both data points you require. Said change will be in the next release.