• 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></style>
    </head>
    
    <body>
      <div id='myChart'></div>
      <button id="markers">Cycle markers</button>
      <script>
        ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
        var myConfig = {
          "type": "scatter",
          "plot": {
            "marker": {
              "border-color": "inherit",
              "height": 10,
              "width": 20,
              "size": 10
            }
          },
          "series": [{
              "values": [
                [1, 9],
                [2, 15],
                [3, 21],
                [4, 30],
                [5, 40],
                [6, 59],
                [7, 60],
                [8, 75],
                [9, 81],
                [10, 99]
              ]
            },
            {
              "values": [
                [0.9, 3],
                [2.1, 13],
                [3.5, 25],
                [4.9, 35],
                [5.3, 41],
                [6.5, 57],
                [7.1, 61],
                [8.7, 70],
                [9.2, 82],
                [9.9, 95]
              ]
            },
            {
              "values": [
                [0.1, 9],
                [1.8, 21],
                [1.9, 29],
                [4.1, 33],
                [4.5, 39],
                [6.9, 51],
                [7.4, 64],
                [8.9, 70],
                [9, 75],
                [9.3, 93]
              ]
            }
          ]
        };
    
        zingchart.render({
          id: 'myChart',
          data: myConfig,
          height: 350,
          width: "100%"
        });
    
        var currentMarker = 0;
    
        document.getElementById('markers').addEventListener('click', function() {
    
          var markers = ["triangle", "square", "diamond", "circle", "trapezoid", "rectangle", "parallelogram", "plus", "cross", "star3", "star4", "star5", "star6", "star7", "star8", "star9", "rpoly3", "rpoly4", "rpoly5", "rpoly6", "rpoly7", "rpoly8", "rpoly9", "gear3", "gear4", "gear5", "gear6", "gear7", "gear8", "gear9", "ellipse"];
    
          if (currentMarker >= markers.length) {
            currentMarker = 0;
          }
    
          zingchart.exec('myChart', 'modify', {
            "data": {
              "plot": {
                "marker": {
                  "type": markers[currentMarker]
                }
              },
              "labels": [{
                "text": "<span style='font-weight:bold;'>Current Marker: </span>" + markers[currentMarker],
                "x": "8%",
                "y": "5%"
              }]
            }
          });
          currentMarker++;
        });
      </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>
      <button id="markers">Cycle markers</button>
    </body>
    
    </html>
    
          
    var myConfig = {
      "type": "scatter",
      "plot": {
        "marker": {
          "border-color": "inherit",
          "height": 10,
          "width": 20,
          "size": 10
        }
      },
      "series": [{
          "values": [
            [1, 9],
            [2, 15],
            [3, 21],
            [4, 30],
            [5, 40],
            [6, 59],
            [7, 60],
            [8, 75],
            [9, 81],
            [10, 99]
          ]
        },
        {
          "values": [
            [0.9, 3],
            [2.1, 13],
            [3.5, 25],
            [4.9, 35],
            [5.3, 41],
            [6.5, 57],
            [7.1, 61],
            [8.7, 70],
            [9.2, 82],
            [9.9, 95]
          ]
        },
        {
          "values": [
            [0.1, 9],
            [1.8, 21],
            [1.9, 29],
            [4.1, 33],
            [4.5, 39],
            [6.9, 51],
            [7.4, 64],
            [8.9, 70],
            [9, 75],
            [9.3, 93]
          ]
        }
      ]
    };
    
    zingchart.render({
      id: 'myChart',
      data: myConfig,
      height: 350,
      width: "100%"
    });
    
    var currentMarker = 0;
    
    document.getElementById('markers').addEventListener('click', function() {
    
      var markers = ["triangle", "square", "diamond", "circle", "trapezoid", "rectangle", "parallelogram", "plus", "cross", "star3", "star4", "star5", "star6", "star7", "star8", "star9", "rpoly3", "rpoly4", "rpoly5", "rpoly6", "rpoly7", "rpoly8", "rpoly9", "gear3", "gear4", "gear5", "gear6", "gear7", "gear8", "gear9", "ellipse"];
    
      if (currentMarker >= markers.length) {
        currentMarker = 0;
      }
    
      zingchart.exec('myChart', 'modify', {
        "data": {
          "plot": {
            "marker": {
              "type": markers[currentMarker]
            }
          },
          "labels": [{
            "text": "<span style='font-weight:bold;'>Current Marker: </span>" + markers[currentMarker],
            "x": "8%",
            "y": "5%"
          }]
        }
      });
      currentMarker++;
    });