• 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;
        }
    
        .zc-ref {
          display: none;
        }
      </style>
    </head>
    
    <body>
      <div id="zc"></div>
      <script>
        ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
        var IDS = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"];
        var data = {};
        for (var i = 0; i < IDS.length; i++) {
          var p = ZC._i_(ZC._r_(10, 90));
          data[IDS[i]] = {
            value: 0,
            dataDem: p,
            dataRep: (100 - p),
            gradientStops: [0.001, p / 100 - 0.01, p / 100 + 0.01, 0.999].join(' '),
          };
        }
    
        var cdata = {
          type: 'tilemap',
          options: {
            map: "USA",
            type: "hex",
            sizeFactor: 1.1,
            tile: {
              fillAngle: 1,
              gradientColors: '#66f #66f #f66 #f66',
              shadow: 1,
              borderWidth: 1,
              borderColor: '#666',
              shadowDistance: 4,
              shadowAlpha: 0.75,
              shadowColor: '#999'
            },
            data: data
          },
          tooltip: {
            text: "<span style='font-size:21px;font-weight:bold'>%name</span><br><br><span style='color:#00f;font-size:17px'>Democrats:</span> %data-dem%<br><span style='color:#f00;font-size:17px'>Republicans:</span> %data-rep%",
            htmlMode: true,
            padding: 10,
            align: 'left',
            fontSize: 17,
            borderWidth: 1,
            borderColor: '#333',
            fontWeight: '600'
          }
        };
    
        zingchart.render({
          id: 'zc',
          data: cdata
        });
      </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="zc"></div>
    </body>
    
    </html>
    html,
    body {
      height: 100%;
      width: 100%;
      margin: 0;
      padding: 0;
    }
    
    #myChart {
      height: 100%;
      width: 100%;
      min-height: 150px;
    }
    
    .zc-ref {
      display: none;
    }
    var IDS = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"];
    var data = {};
    for (var i = 0; i < IDS.length; i++) {
      var p = ZC._i_(ZC._r_(10, 90));
      data[IDS[i]] = {
        value: 0,
        dataDem: p,
        dataRep: (100 - p),
        gradientStops: [0.001, p / 100 - 0.01, p / 100 + 0.01, 0.999].join(' '),
      };
    }
    
    var cdata = {
      type: 'tilemap',
      options: {
        map: "USA",
        type: "hex",
        sizeFactor: 1.1,
        tile: {
          fillAngle: 1,
          gradientColors: '#66f #66f #f66 #f66',
          shadow: 1,
          borderWidth: 1,
          borderColor: '#666',
          shadowDistance: 4,
          shadowAlpha: 0.75,
          shadowColor: '#999'
        },
        data: data
      },
      tooltip: {
        text: "<span style='font-size:21px;font-weight:bold'>%name</span><br><br><span style='color:#00f;font-size:17px'>Democrats:</span> %data-dem%<br><span style='color:#f00;font-size:17px'>Republicans:</span> %data-rep%",
        htmlMode: true,
        padding: 10,
        align: 'left',
        fontSize: 17,
        borderWidth: 1,
        borderColor: '#333',
        fontWeight: '600'
      }
    };
    
    zingchart.render({
      id: 'zc',
      data: cdata
    });