Leah
Posts: 19
Joined: Thu Sep 08, 2022 11:53 am

Export Menu with Right Click

Hello,

Is it possible to offer the exporting options without the export button showing on the chart and instead use a right click menu on the actual chart?

As a follow up, would it be possible to add a custom button to the export menu?

Thanks
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Export Menu with Right Click

Hi Leah!
We appreciate you reaching out to us!

You can simulate a right-click on SVG g-element, by using dispatchEvent method and extra listener on the chart container.

To change the context of the menu you can use exporting.buttons.contextButton.menuItems and exporting.menuItemDefinitions. Just like in the demo below.

Demo: https://jsfiddle.net/BlackLabel/he85wn76/
API Reference: https://api.highcharts.com/highstock/ex ... .menuItems
https://api.highcharts.com/highstock/ex ... .menuItems
https://api.highcharts.com/highstock/ex ... efinitions

Let me know if you have any further questions.
Regards!
Hubert Kozik
Highcharts Developer
Leah
Posts: 19
Joined: Thu Sep 08, 2022 11:53 am

Re: Export Menu with Right Click

Thank you, I was hoping it would use the browser context menu but after googling I don't think that is even possible! However adding the custom menu option is very useful, thank you :D
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Export Menu with Right Click

You're welcome! In case of any further questions, feel free to contact us again.
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”