• 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>
            html,
            body,
            #myChart {
                height: 100%;
                width: 100%;
            }
    
            zing-grid[loading] {
                height: 450px;
            }
        </style>
    </head>
    
    <body>
        <div id='myChart'></div>
        <script>
            ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"];
            var myConfigXd = {
                "type": "hmixed",
                "plot": {
                    "bars-overlap": "100%",
                    "stacked": true,
                },
                "scale-x": {
                    "labels": ["Superior", "Michigan", "Huron", "Erie", "Ontario"],
                    "guide": {
                        "visible": false
                    }
                },
                "scale-y": {
                    "values": "0:50:10",
                    "guide": {
                        "visible": false
                    }
                },
                "series": [{ //Range Bar 1
                        "type": "hbar",
                        "values": [25, 30, 15, 20, 25],
                        "stack": 1,
                        "background-color": "gray",
                        "alpha": 0.7,
                        "hover-state": {
                            "visible": false
                        },
                        "max-trackers": 0,
                    },
                    { //Range Bar 2
                        "type": "hbar",
                        "values": [20, 10, 30, 25, 15],
                        "stack": 1,
                        "background-color": "gray",
                        "alpha": 0.5,
                        "hover-state": {
                            "visible": false
                        },
                        "max-trackers": 0,
                    },
                    { //Range Bar 3
                        "type": "hbar",
                        "values": [5, 10, 5, 5, 10],
                        "stack": 1,
                        "background-color": "gray",
                        "alpha": 0.3,
                        "hover-state": {
                            "visible": false
                        },
                        "max-trackers": 0,
                    },
                    { //Bullet Bar
                        "type": "hbar",
                        "values": [35, 42, 40, 43, 36],
                        "bar-width": "50%",
                        "stack": 2,
                        "background-color": "#99CCFF",
                        "hover-state": {
                            "visible": false
                        },
                        "tooltip": {
                            "text": "Actual: %v",
                            "font-color": "black",
                            "background-color": "white"
                        }
                    },
                    { //Goal 1 (cross)
                        "type": "hscatter",
                        "values": [21, 33, 25, 30, 12],
                        "marker": {
                            "type": "cross",
                            "line-color": "red",
                            "size": 5
                        },
                        "tooltip": {
                            "text": "Cross Goal: %v",
                            "font-color": "black",
                            "background-color": "white",
                        }
                    },
                    { //Goal 2 (target)
                        "type": "hscatter",
                        "values": [30, 37, 30, 37, 25],
                        "marker": {
                            "background-image": "https://www.zingchart.com/resources/target.png",
                            "background-color": "none",
                            "border-color": "none",
                            "background-repeat": "no-repeat",
                            "shadow": false,
                            "size": 12
                        },
                        "tooltip": {
                            "text": "Target Goal: %v",
                            "font-color": "black",
                            "background-color": "white"
                        }
                    },
                    { //Goal 2 (star)
                        "type": "hscatter",
                        "values": [39, 45, 36, 45, 40],
                        "marker": {
                            "type": "star5",
                            "background-color": "#FFFF00",
                            "border-color": "#99CCFF",
                            "border-width": 1,
                            "size": 7
                        },
                        "tooltip": {
                            "text": "Star Goal: %v",
                            "font-color": "black",
                            "background-color": "white"
                        }
                    },
    
                ]
            };
    
            zingchart.render({
                id: 'myChart',
                data: myConfigXd,
                height: "100%",
                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>
    html,body,#myChart{height: 100%;width: 100%;}
    var myConfigXd = {
      "type":"hmixed",
      "plot":{
     	  "bars-overlap":"100%",
     	  "stacked":true,
     	},
     	"scale-x":{
     	  "labels":["Superior","Michigan","Huron","Erie","Ontario"],
     	  "guide":{
     	    "visible":false
     	  }
     	},
     	"scale-y":{
     	  "values":"0:50:10",
     	  "guide":{
     	    "visible":false
     	  }
     	},
      "series": [
        { //Range Bar 1
          "type":"hbar",
          "values":[25,30,15,20,25],
          "stack":1,
          "background-color":"gray",
          "alpha":0.7,
          "hover-state":{
    			  "visible":false
    			},
    			"max-trackers":0,
        },
        { //Range Bar 2
          "type":"hbar",
          "values":[20,10,30,25,15],
          "stack":1,
          "background-color":"gray",
          "alpha":0.5,
          "hover-state":{
    			  "visible":false
    			},
    			"max-trackers":0,
        },
        { //Range Bar 3
          "type":"hbar",
          "values":[5,10,5,5,10],
          "stack":1,
          "background-color":"gray",
          "alpha":0.3,
          "hover-state":{
    			  "visible":false
    			},
    			"max-trackers":0,
        },
        { //Bullet Bar
          "type":"hbar",
          "values":[35,42,40,43,36],
          "bar-width":"50%",
          "stack":2,
          "background-color":"#99CCFF",
          "hover-state":{
    			  "visible":false
    			},
          "tooltip":{
            "text":"Actual: %v",
            "font-color":"black",
            "background-color":"white"
          }
        },
        { //Goal 1 (cross)
          "type":"hscatter",
          "values":[21,33,25,30,12],
          "marker":{
            "type":"cross",
    		    "line-color":"red",
    		    "size":5
          },
          "tooltip":{
            "text":"Cross Goal: %v",
            "font-color":"black",
            "background-color":"white",
          }
        },
        { //Goal 2 (target)
          "type":"hscatter",
          "values":[30,37,30,37,25],
    			"marker":{
    			  "background-image":"https://www.zingchart.com/resources/target.png",
    			  "background-color":"none",
       	    "border-color":"none",
       	    "background-repeat":"no-repeat",
       	    "shadow":false,
    			  "size": 12
    			},
          "tooltip":{
            "text":"Target Goal: %v",
            "font-color":"black",
            "background-color":"white"
          }
        },
        { //Goal 2 (star)
          "type":"hscatter",
          "values":[39,45,36,45,40],
          "marker":{
    			  "type":"star5",
    			  "background-color":"#FFFF00",
       	    "border-color":"#99CCFF",
       	    "border-width":1,
       	    "size":7
          },
          "tooltip":{
            "text":"Star Goal: %v",
            "font-color":"black",
            "background-color":"white"
          }
        },
     
      ]
    };
    
    zingchart.render({ 
    	id : 'myChart', 
    	data : myConfigXd, 
    	height : "100%", 
    	width: "100%" 
    });