• 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></style>
    </head>
    
    <body>
      <div id='myChart'></div>
      <script>
        ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
        var myConfig = {
          "type": "bar",
          "title": {
            "text": "Legend Tooltips"
          },
          "legend": {
            "x": "25%",
            "y": "12%",
            "layout": "horizontal",
            "align": "center",
            "offset-y": "50px",
            "tooltip": { //Legend Tooltips
              "text": "The %t population is %plot-description",
              "width": "20%",
              "height": "20%",
              "wrap-text": true,
              "padding": "5%",
              "background-color": "white",
              "font-color": "black",
              "font-family": "Georgia",
              "border-width": 1,
              "border-color": "gray",
              "border-radius": "5px",
              "sticky": true,
              "timeout": 10000
            }
          },
          "plotarea": {
            "margin-top": "25%"
          },
          "plot": {
            "stacked": true,
            "bar-width": "30%"
          },
          "scale-x": {
            "labels": ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M"]
          },
          "scale-y": {
            "values": "0:200:50"
          },
          "series": [{
              "values": [64, 59, 55, 49, 39, 35, 31, 20, 16, 15, 9, 5, 4],
              "text": "0-18 years",
              "description": "depicted in blue."
            },
            {
              "values": [99, 90, 87, 70, 59, 51, 45, 39, 34, 25, 21, 9, 5],
              "text": "18-64 years",
              "description": "depicted in red."
            },
            {
              "values": [34, 30, 16, 15, 14, 12, 10, 9, 8, 7, 5, 4, 3],
              "text": "65 and over",
              "description": "depicted in green."
            }
          ]
        };
    
        zingchart.render({
          id: 'myChart',
          data: myConfig,
          height: 400,
          width: "100%"
        });
      </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": "bar",
      "title": {
        "text": "Legend Tooltips"
      },
      "legend": {
        "x": "25%",
        "y": "12%",
        "layout": "horizontal",
        "align": "center",
        "offset-y": "50px",
        "tooltip": { //Legend Tooltips
          "text": "The %t population is %plot-description",
          "width": "20%",
          "height": "20%",
          "wrap-text": true,
          "padding": "5%",
          "background-color": "white",
          "font-color": "black",
          "font-family": "Georgia",
          "border-width": 1,
          "border-color": "gray",
          "border-radius": "5px",
          "sticky": true,
          "timeout": 10000
        }
      },
      "plotarea": {
        "margin-top": "25%"
      },
      "plot": {
        "stacked": true,
        "bar-width": "30%"
      },
      "scale-x": {
        "labels": ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M"]
      },
      "scale-y": {
        "values": "0:200:50"
      },
      "series": [{
          "values": [64, 59, 55, 49, 39, 35, 31, 20, 16, 15, 9, 5, 4],
          "text": "0-18 years",
          "description": "depicted in blue."
        },
        {
          "values": [99, 90, 87, 70, 59, 51, 45, 39, 34, 25, 21, 9, 5],
          "text": "18-64 years",
          "description": "depicted in red."
        },
        {
          "values": [34, 30, 16, 15, 14, 12, 10, 9, 8, 7, 5, 4, 3],
          "text": "65 and over",
          "description": "depicted in green."
        }
      ]
    };
    
    zingchart.render({
      id: 'myChart',
      data: myConfig,
      height: 400,
      width: "100%"
    });