New to Kendo UI for jQuery? Download free 30-day trial

Handle Right Click in Charts

Environment

Product Progress Kendo UI Chart for jQuery
Operating System Windows 10 64bit
Visual Studio version Visual Studio 2017
Preferred Language JavaScript

Description

How can I manage the right click in the Chart?

Solution

The following example demonstrates how to handle the right click in Kendo UI Charts.

    <div id="chart"></div>
    <script>
       $("#chart").kendoChart({
          title: {
            text: "Gross domestic product growth /GDP annual %/"
          },
          legend: {
            position: "top"
          },
          seriesDefaults: {
            type: "column"
          },
          series: [{          
            name: "World",
            data: [1, 2, 3, 4, 5]
          }],         
          categoryAxis: {
            categories: [2002, 2003, 2004, 2005, 2006]
          }
        });

        $("#chart").on("contextmenu", function(e) {
          e.preventDefault();        
            alert("Right clicked!");
        });
    </script>

See Also

In this article