Support for contextmenu event
Please add support for contextmenu event handlers, or mousedown/mouseup/click events which are captured, to be able to prevent default browser right-click popup menu.
It would be useful to have an ability to show custom menu on different parts of chart (slice/series/point/legend etc.) with according info respectively.
I’ve tried to modify Joe’s patch into a plugin so that it can run without modifying Highcharts itself. The result can be seen at http://jsfiddle.net/highcharts/c42Ms/.
I didn’t have time right now to check across browsers, but I’m open for suggestions for improvements.
-
Thanks for reporting, I updated the plugin for HC 3.0
-
Bastian Buchholz commented
The patch does not work anymore with Highcharts 3.0...
-
Thanks, I added it to the plugin.
-
Bastian Buchholz commented
Or you can set e.returnValue to false.
Example: http://jsfiddle.net/q6AR9/1/
-
Bastian Buchholz commented
In IE 8 a return false; at the end of the oncontextmenu function would be useful to prevent that the browsers contextmenu is shown.
A simple preventDefault is not enough.Here is the fork with the patch: http://jsfiddle.net/g69Uq/
-
Thanks for reporting, I've added support for scatter.
-
Allen Kim commented
Nice plugin but, this does not work for scatter type.
-
Great! And thanks so much for your nice blog post.
-
Javier Andres Caceres Alvis commented
Hello Torstein,
I tested in the following browsers and it worked ok:
IE 10.0.92
Firefox 16.0.2
Chrome 22.0.1
Thanks a millon -
Javier Andres Caceres Alvis commented
Hi there,
The same question than asd: was this request developed? If it wasn't how can we use it while keeping compatibility with the current/last release? ( I mean, how to use it without loosing future releases?
Thanks; -
asd commented
Is this patch official? Is there any way to distribute just what it changed instead of the full library code?
-
Anonymous commented
Has this been added to highcharts ?
-
Joe Kuan commented
FYI, I only tested it on Safari 5, IE8 and Firefox 5. They all work fine.
-
That code seems to be jQuery specific...
-
Adrian A. commented
> I have modified the Highcharts 2.1.4 to support context menu..
Very nice :).Would someone from Highcharts simply include this patch?
-
Joe Kuan commented
I have modified the Highcharts 2.1.4 to support context menu. See http://joekuan.wordpress.com/2011/05/11/making-highcharts-support-right-click-context-menu/
-
Joe Kuan commented
I would like this option.