First: do you download the ZingChart library? I just ask, as it is not included in your demo. If not, paste this into <head>our file:
<script src='http://cdn.zingchart.com/zingchart.min.js'></script>
Your object is chartDataalso missing a type.
Your chartDataobject also lacks a missing closing bracket.
. ZingChart. , - .
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
<script src='http://cdn.zingchart.com/zingchart.min.js'></script>
</head>
<body>
<script>
var chartData = {
"type":"line",
"refresh": {
"type": "feed",
"transport": "js",
"url": "feed()",
"interval": 200
},
"series":[
{
"values":[]
}
]
};
window.onload = function() {
zingchart.render({
id: "chartDiv",
data: chartData,
height: 600,
width: "100%"
});
};
window.feed = function(callback) {
var tick = {};
tick.plot0 = parseInt(10 + 900 * Math.random(), 10);
callback(JSON.stringify(tick));
};
</script>
<div id='chartDiv'></div>
</body>
</html>
Hide result