Making Highcharts support right-click context menu
Currently, Highcharts (v2.1.4) doesn’t support (right click) context menu but this is in the feature request. Unfortunately, I don’t have the luxury to wait for the democratic process. So I did it the hard way and spent half a day to understand the Highcharts code and made the necessary changes to support right click context menu.
First, download and apply the patch diff to your Highcharts source code. Then to make the Highcharts context menu feature, you need to define the context menu event handler in the config, same as how you define click handler. Here is an example for a column chart:
.... plotOptions: { column: { allowPointSelect: true, events: { // Default action for (left) clicking the data click: function(point) { }, // (Right-click) Create a menu for the data point contextmenu: function(point) { .... }, } } } ....
Here is a screenshot of my ExtJS (3.2) application integrated with HighChart and using context menu.
Tested on IE8, Safari 5 and Firefox. Let me know if you find any problem.
Awesome!! What version fo highcharts are you using this with?
2.1.4 (the latest one), also I have tried the changes with 2.1.0 and it works fine.
Hi, seems you understand both highchart and extjs. Do you also know if highcharts can be integrated with Jasper reports? http://http://jasperforge.org/
link is jasperforge.org/
Sorry, I have no experience of Jasper. However, Highcharts have pretty flexible interfaces, it may be possible to integrate.
Any plan to migrate the patch to current version (2.3.3)?
It would be very handy to isolate the changes in order to be able to use future HighSoft’s updates as well as yours
Hi there,
Did you see my previous message? Just in case you did not:
Any plan to migrate the patch to current version (2.3.3)?
It would be very handy to isolate the changes in order to be able to use future HighSoft’s updates as well as yours
I forgot to ask:
how to use it without loosing future releases?
Sorry for the late reply. No for two reasons:
1) Involves changing source code and actually not straightforward. Also I have to keep up with the Highcharts regular release. This feature should really be supported by Highcharts instead of contribution.
2) Insanely busy. Too many family issues lately + writing Highcharts book + demanding work + other projects to maintain
Hello Joe,
Thanks for your response and I agree with you in “This feature should really be supported by Highcharts”
Hi Joe: your contribution was just converted to a plugin in the Highcharts user voice site as a workaround to keep the context menu code separated from the official release. I see it was wrapped into the Highcharts.wrap method to keep current functionality plus plugin functionality. Thanks again,
Thanks again. Nice work