• 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>
            zing-grid[loading] {
                height: 400px;
            }
        </style>
    </head>
    
    <body>
        <div id='myChart'></div>
        <script>
            ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
            var myConfig = {
                type: 'null',
                shapes: [{
                        type: 'square',
                        group: 1,
                        size: 15,
                        backgroundColor: 'red',
                        x: 15,
                        y: 20,
                        hoverState: {
                            backgroundColor: 'yellow'
                        }
                    },
                    {
                        type: 'square',
                        group: 1,
                        size: 15,
                        backgroundColor: 'red',
                        x: 55,
                        y: 50,
                        hoverState: {
                            backgroundColor: 'yellow'
                        }
                    },
                    {
                        type: 'square',
                        group: 2,
                        size: 15,
                        backgroundColor: 'orange',
                        x: 95,
                        y: 50,
                        hoverState: {
                            backgroundColor: 'green'
                        }
                    },
                    {
                        type: 'square',
                        group: 2,
                        size: 15,
                        backgroundColor: 'orange',
                        x: 125,
                        y: 30,
                        hoverState: {
                            backgroundColor: 'green'
                        }
                    }
                ]
            }
            zingchart.render({
                "id": 'myChart',
                "width": '100%',
                "height": 400,
                "data": myConfig
            });
    
            setTimeout(function() {
                zingchart.exec('myChart', 'updateobject', {
                    type: 'shape',
                    group: 1,
                    data: {
                        backgroundColor: 'black'
                    }
                });
                zingchart.exec('myChart', 'updateobject', {
                    type: 'shape',
                    group: 2,
                    data: {
                        backgroundColor: 'brown'
                    }
                });
            }, 2000)
        </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: 'null',
      shapes:[
        {
          type: 'square',
          group: 1,
          size: 15,
          backgroundColor:'red',
          x:15,
          y:20,
          hoverState: {
            backgroundColor: 'yellow'
          }
        },
        {
          type: 'square',
          group: 1,
          size: 15,
          backgroundColor:'red',
          x:55,
          y:50,
          hoverState: {
            backgroundColor: 'yellow'
          }
        } ,
        {
          type: 'square',
          group: 2,
          size: 15,
          backgroundColor:'orange',
          x:95,
          y:50,
          hoverState: {
            backgroundColor: 'green'
          }
        },
        {
          type: 'square',
          group: 2,
          size: 15,
          backgroundColor:'orange',
          x:125,
          y:30,
          hoverState: {
            backgroundColor: 'green'
          }
        }   
      ]
    }
    zingchart.render({
      "id":'myChart',
      "width":'100%',
      "height":400,
      "data":myConfig
    });
    
    setTimeout(function() {
      zingchart.exec('myChart', 'updateobject', {
        type: 'shape',
        group: 1,
        data: {
          backgroundColor: 'black'
        }
      });
      zingchart.exec('myChart', 'updateobject', {
        type: 'shape',
        group: 2,
        data: {
          backgroundColor: 'brown'
        }
      });
    }, 2000)