• Edit
  • Download
  • <!DOCTYPE html>
    <html>
    
    <head>
        <meta charset="utf-8">
        <title>ZingSoft Demo</title>
    
        <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
        <style>
            zing-grid[loading] {
                height: 800px;
            }
        </style>
    </head>
    
    <body>
        <div id='myChart'></div>
        <script>
            ZC.LICENSE = ["b55b025e438fa8a98e32482b5f768ff5"];
            var myJson = {
                "gui": {
                    "context-menu": {
                        "visible": true,
                        "custom-items": [{
                            "text": "Custom Zoom Out",
                            "function": "window.xalert()",
                            "id": "customItem1"
                        }]
                    }
                },
                "graphset": [{
                    "type": "bar",
                    "title": {
                        "text": "Zoom In"
                    },
                    "subtitle": {
                        "text": "Then Right Click For Context Menu"
                    },
                    "scale-x": {
                        "zooming": true
                    },
                    "series": [{
                        "values": [35, 15, 22, 30, 27, 15, 35, 28, 14, 1, 9, 15, 12, 21, 31, 25, 29, 40]
                    }]
                }]
            };
            zingchart.render({
                id: 'myChart',
                data: myJson,
                height: 400,
                width: '100%'
            });
    
            window.xalert = function(p) {
                zingchart.exec('myChart', 'zoomto')
            }
        </script>
    </body>
    
    </html>
    <!DOCTYPE html>
    <html>
    	<head>
        <meta charset="utf-8">
        <title>ZingSoft Demo</title>
    	
    		<script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    </head>
    	<body>
    		<div id='myChart'></div>
    	</body>
    </html>
    
          
    var myJson = {
        "gui":{
            "context-menu":{
                "visible":true,
                "custom-items":[
                    {
                        "text":"Custom Zoom Out",
                        "function":"window.xalert()",
                        "id":"customItem1"
                    }
                ]
            }
    },
        "graphset": [
            {
                "type": "bar",
                "title": {
                  "text":"Zoom In"
                },
                "subtitle": {
                  "text":"Then Right Click For Context Menu"
                },
                "scale-x":{
                    "zooming":true
                },
                "series": [
                    {
                        "values": [35,15,22,30,27,15,35,28,14,1,9,15,12,21,31,25,29,40]
                    }
                ]
            }
        ]
    };
    zingchart.render({ 
    	id : 'myChart', 
    	data : myJson, 
    	height: 400, 
    	width: '100%' 
    });
    
    window.xalert = function(p) {
      zingchart.exec('myChart','zoomto')
    }