-3

Based on the documentation there's an event to handle the context menu for echarts but I couldn't find any sample on how to implement it and how to add a context menu.

https://apache.github.io/echarts-handbook/en/concepts/event#handling-the-mouse-events

Thank you.

Jon
  • 35
  • 3

1 Answers1

1

Concerning event listener implementation the via zrender echart.getZr().on is the more user friendly way, except you want to force clicking on echart elements with echart.on

myChart.getZr().on('contextmenu', function(params) {console.log("right clicked")});

I don't think there is further contextmenu support from echarts, it would be nice to have a similar stylable one.

But from that point onward you can implement your own context menu.

Daraan
  • 1,797
  • 13
  • 24