• Edit
  • Download
  • <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <title>ZingSoft Demo</title>
      <script nonce="undefined" src='http://cdn.zingchart.com/zingchart.min.js'></script>
    
      <script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
      <style></style>
    </head>
    
    <body>
      <div id='myChart'></div>
      <script>
        ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
        var myJson = {
          "graphset": [{
            "type": "hbar",
            "background-color": "#F2F2F2",
            "plotarea": {
              "margin-top": "10px",
              "margin-right": "25px",
              "margin-bottom": "25px",
              "margin-left": "60px"
            },
            "scale-x": {
              "guide": {
                "visible": 0
              },
              "labels": [
                "Scenario",
                "Baseline"
              ],
              "item": {
                "font-size": 13
              },
              "line-color": "#868686",
              "tick": {
                "visible": 0
              }
            },
            "scale-y": {
              "thousands-separator": ",",
              "format": "javascript:myFormat()",
              "guide": {
                "visible": 0
              },
              "line-color": "#868686",
              "tick": {
                "line-color": "#868686"
              },
              "item": {
                "font-size": 13
              }
            },
            "plot": {
              "bar-width": 30,
              "bar-space": 100
            },
            "series": [{
              "values": [
                10,
                -100
              ],
              "rules": [{
                  "rule": "%k==0",
                  "background-color": "#95B3D7",
                  "border-width": 2,
                  "line-style": "dashed",
                  "border-color": "#002060"
                },
                {
                  "rule": "%k==1",
                  "background-color": "#254061"
                }
              ]
            }],
            "tooltip": {
              "text": "%data-tooltip",
              "thousands-separator": ",",
              "sticky": 1,
              "timeout": 750
            }
          }]
        };
        zingchart.render({
          id: 'myChart',
          data: myJson,
          height: 400,
          width: 600
        });
    
        window.myFormat = function(val) {
          if (val < 0) {
            return "($" + Math.abs(val) + ")";
          } else {
            return "$" + val;
          }
        };
      </script>
    </body>
    
    </html>
    <!DOCTYPE html>
    <html>
    
    <head>
      <meta charset="utf-8">
      <title>ZingSoft Demo</title>
      <script src='http://cdn.zingchart.com/zingchart.min.js'></script>
    
      <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
    </head>
    
    <body>
      <div id='myChart'></div>
    </body>
    
    </html>
    
          
    var myJson = {
      "graphset": [{
        "type": "hbar",
        "background-color": "#F2F2F2",
        "plotarea": {
          "margin-top": "10px",
          "margin-right": "25px",
          "margin-bottom": "25px",
          "margin-left": "60px"
        },
        "scale-x": {
          "guide": {
            "visible": 0
          },
          "labels": [
            "Scenario",
            "Baseline"
          ],
          "item": {
            "font-size": 13
          },
          "line-color": "#868686",
          "tick": {
            "visible": 0
          }
        },
        "scale-y": {
          "thousands-separator": ",",
          "format": "javascript:myFormat()",
          "guide": {
            "visible": 0
          },
          "line-color": "#868686",
          "tick": {
            "line-color": "#868686"
          },
          "item": {
            "font-size": 13
          }
        },
        "plot": {
          "bar-width": 30,
          "bar-space": 100
        },
        "series": [{
          "values": [
            10,
            -100
          ],
          "rules": [{
              "rule": "%k==0",
              "background-color": "#95B3D7",
              "border-width": 2,
              "line-style": "dashed",
              "border-color": "#002060"
            },
            {
              "rule": "%k==1",
              "background-color": "#254061"
            }
          ]
        }],
        "tooltip": {
          "text": "%data-tooltip",
          "thousands-separator": ",",
          "sticky": 1,
          "timeout": 750
        }
      }]
    };
    zingchart.render({
      id: 'myChart',
      data: myJson,
      height: 400,
      width: 600
    });
    
    window.myFormat = function(val) {
      if (val < 0) {
        return "($" + Math.abs(val) + ")";
      } else {
        return "$" + val;
      }
    };