ZingChart: Disabling the Context Menu
The context menu is what appears when you right-click on an area of the chart. It allows for further chart interactions such as reloading the chart, viewing it as an image, printing the chart, and more. You can enable or disable various context menu items, as well as create your own custom items.
Below, see what the context menu looks like by default in a chart.
Example: https://app.zingsoft.com/demos/view/GR70I1LL
If you do not want your chart to display the context menu, you can add the following code to disable showing it on a right click.
<code>zingchart.bind('myChart', 'contextmenu', function(p) { return false; <br>});
Example: https://app.zingsoft.com/demos/view/7OY7TF8K
However, the above method only disables the right-click to open the context menu. On mobile views, a hamburger menu will appear in the upper left corner to display the context menu.
In order to disable to mobile context menu, add the following code to your chart configuration object:
<code>"gui":{ <br> "contextMenu":{ <br> "button":{ <br> "visible": false <br> } <br> } <br>}, <br>// ...
Once this is added, the hamburger menu will no longer be visible on mobile views.
Example: https://app.zingsoft.com/demos/view/LS3Y6XC6
Related Articles: