• 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 myConfig = {
                "type": "pie",
                "title": {
                    "text": "Browser market shares. January, 2015 to May, 2015"
                },
                "subtitle": {
                    "text": "Click the columns to view that browser homepage"
                },
                "plot": {
                    "cursor": "hand",
                    "value-box": {
                        "placement": "out",
                        "text": "%v%",
                    },
                    "tooltip": {
                        "text": "%t"
                    },
                    "detach": false
                },
                "series": [{
                        "values": [
                            56.33
                        ],
                        "text": "Internet Explorer"
                    },
                    {
                        "values": [
                            24
                        ],
                        "text": "Chrome"
                    },
                    {
                        "values": [
                            10.4
                        ],
                        "text": "Firefox"
                    },
                    {
                        "values": [
                            4.8
                        ],
                        "text": "Safari"
                    },
                    {
                        "values": [
                            1.1
                        ],
                        "text": "Opera"
                    }
                ]
            };
    
            zingchart.render({
                id: 'myChart',
                data: myConfig,
                height: 400,
                width: '100%'
            });
    
            /**
             * Handle the click event. Based on the plot clicked
             * re-direct the user!
             */
            zingchart.node_click = function(e) {
                switch (e.plotindex) {
                    case 4:
                        window.open('https://www.opera.com/', '_blank');
                        break;
                    case 3:
                        window.open('https://www.apple.com/safari/', '_blank');
                        break;
                    case 2:
                        window.open('https://www.mozilla.org', '_blank');
                        break;
                    case 1:
                        window.open('https://www.google.com/chrome/', '_blank');
                        break;
                    default:
                        window.open('https://www.microsoft.com/en-us/download/internet-explorer.aspx', '_blank');
                        break;
                }
            }
        </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 myConfig = {
      "type": "pie",
      "title": {
        "text": "Browser market shares. January, 2015 to May, 2015"
      },
      "subtitle": {
        "text": "Click the columns to view that browser homepage"
      },
      "plot": {
        "cursor": "hand",
        "value-box": {
          "placement":"out",
          "text": "%v%",
        },
        "tooltip": {
          "text":"%t"
        },
        "detach":false
      },
      "series": [
        {
          "values": [
            56.33
            ],    
          "text":"Internet Explorer"
        },
        {
          "values": [
            24
            ],    
          "text":"Chrome"
        },
        {
          "values": [
            10.4
            ],    
          "text":"Firefox"
        },
        {
          "values": [
            4.8
            ],    
          "text":"Safari"
        },
        {
          "values": [
            1.1
            ],    
          "text":"Opera"
        }
      ]
    };
    
    zingchart.render({
    	id : 'myChart', 
    	data : myConfig, 
    	height: 400, 
    	width: '100%'
    });
    
    /**
     * Handle the click event. Based on the plot clicked
     * re-direct the user!
     */
    zingchart.node_click = function(e) {
      switch(e.plotindex) {
        case 4:
          window.open('https://www.opera.com/', '_blank');
          break;
        case 3:
          window.open('https://www.apple.com/safari/', '_blank');
          break;
        case 2:
          window.open('https://www.mozilla.org', '_blank');
          break;
        case 1:
          window.open('https://www.google.com/chrome/', '_blank');
          break;
        default:
          window.open('https://www.microsoft.com/en-us/download/internet-explorer.aspx', '_blank');
          break;
      }
    }