• Edit
  • Download
  • <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <title>ZingSoft Demo</title>
    
      <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
      <style>
        html,
        body {
          height: 100%;
          width: 100%;
          margin: 0;
          padding: 0;
        }
    
        #myChart {
          height: 100%;
          width: 100%;
          min-height: 150px;
        }
      </style>
    </head>
    
    <body>
      <div id="myChart"></div>
      <script>
        ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
        let chartConfig = {
          "graphset": [{
              "id": "years",
              "x": "0%",
              "y": "0%",
              "width": "100%",
              "height": "40%",
              "type": "bar",
              "title": {
                "text": "Parent Child Drilldown"
              },
              "plotarea": {
                "margin-top": 50,
                "margin-right": 30,
                "margin-bottom": 40,
                "margin-left": 50
              },
              "scale-x": {
                "values": "1994:2014",
                "max-items": 99,
                "guide": {
                  "visible": false
                }
              },
              "plot": {
                "bars-overlap": "100%",
                "rules": []
              },
              "scale-y": {
                "values": "0:150:25",
                "min-value": 0,
                "guide": {
                  "visible": false
                }
              },
              "series": [{
                  "values": [81, 106, 110, 114, 133, 108, 101, 120, 116, 113, 123, 130, 132, 124, 128, 122, 115, 104, 123, 146, 113],
                  // this url is the request for months and following filpath is the link to the second page used with data_months 
                  "url": "https://us-central1-zingchart-com.cloudfunctions.net/public_pie_datamonths?year=%scale-key-value&filepath=https://us-central1-zingchart-com.cloudfunctions.net/public_pie_datadays",
                  "target": "graph=months", // the chart id to target the config returned from the url. So within data_months_php the target will be graph=days
                  "z-index": 1
                },
                { //just to make the background gray...
                  "values": [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                  "background-color": "#E8E7E8",
                  "maxTrackers": 0,
                  "z-index": 0
                }
              ]
            },
            {
              "id": "months",
              "x": "0%",
              "y": "40%",
              "width": "100%",
              "height": "30%",
              "type": "null",
              "labels": [{
                "text": "Click on a YEAR above to view monthly stats",
                "width": "70%",
                "height": 40,
                "margin": "auto auto",
                "border-width": 1,
                "border-radius": 2,
                "padding": 20,
                "background-color": "#f9f9f9"
              }]
            },
            {
              "id": "days",
              "x": "0%",
              "y": "70%",
              "width": "100%",
              "height": "30%",
              "type": "null",
              "scale-x": {
                "max-labels": 16
              },
              "labels": [{
                "text": "Click on a MONTH above to view daily stats",
                "width": "70%",
                "height": 40,
                "margin": "auto auto",
                "border-width": 1,
                "border-radius": 2,
                "padding": 20,
                "background-color": "#f9f9f9"
              }]
            }
          ],
          "background-color": "white"
        };
    
        zingchart.render({
          id: 'myChart',
          data: chartConfig,
          height: '100%',
          width: '100%',
          cachePolicy: '',
        });
      </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>
    html,
    body {
      height: 100%;
      width: 100%;
      margin: 0;
      padding: 0;
    }
    
    #myChart {
      height: 100%;
      width: 100%;
      min-height: 150px;
    }
    let chartConfig = {
      "graphset": [{
          "id": "years",
          "x": "0%",
          "y": "0%",
          "width": "100%",
          "height": "40%",
          "type": "bar",
          "title": {
            "text": "Parent Child Drilldown"
          },
          "plotarea": {
            "margin-top": 50,
            "margin-right": 30,
            "margin-bottom": 40,
            "margin-left": 50
          },
          "scale-x": {
            "values": "1994:2014",
            "max-items": 99,
            "guide": {
              "visible": false
            }
          },
          "plot": {
            "bars-overlap": "100%",
            "rules": []
          },
          "scale-y": {
            "values": "0:150:25",
            "min-value": 0,
            "guide": {
              "visible": false
            }
          },
          "series": [{
              "values": [81, 106, 110, 114, 133, 108, 101, 120, 116, 113, 123, 130, 132, 124, 128, 122, 115, 104, 123, 146, 113],
              // this url is the request for months and following filpath is the link to the second page used with data_months 
              "url": "https://us-central1-zingchart-com.cloudfunctions.net/public_pie_datamonths?year=%scale-key-value&filepath=https://us-central1-zingchart-com.cloudfunctions.net/public_pie_datadays",
              "target": "graph=months", // the chart id to target the config returned from the url. So within data_months_php the target will be graph=days
              "z-index": 1
            },
            { //just to make the background gray...
              "values": [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
              "background-color": "#E8E7E8",
              "maxTrackers": 0,
              "z-index": 0
            }
          ]
        },
        {
          "id": "months",
          "x": "0%",
          "y": "40%",
          "width": "100%",
          "height": "30%",
          "type": "null",
          "labels": [{
            "text": "Click on a YEAR above to view monthly stats",
            "width": "70%",
            "height": 40,
            "margin": "auto auto",
            "border-width": 1,
            "border-radius": 2,
            "padding": 20,
            "background-color": "#f9f9f9"
          }]
        },
        {
          "id": "days",
          "x": "0%",
          "y": "70%",
          "width": "100%",
          "height": "30%",
          "type": "null",
          "scale-x": {
            "max-labels": 16
          },
          "labels": [{
            "text": "Click on a MONTH above to view daily stats",
            "width": "70%",
            "height": 40,
            "margin": "auto auto",
            "border-width": 1,
            "border-radius": 2,
            "padding": 20,
            "background-color": "#f9f9f9"
          }]
        }
      ],
      "background-color": "white"
    };
    
    zingchart.render({
      id: 'myChart',
      data: chartConfig,
      height: '100%',
      width: '100%',
      cachePolicy: '',
    });