corridor_control/fan_control/data/index.html

38 lines
998 B
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<title>My first Chartist Tests</title>
<link rel="stylesheet" href="chartist.min.css.gz">
<style>
.ct-chart{
width: 90%;
height: 300px;
}
</style>
</head>
<body>
<h1> Weekly </h1>
<div class="ct-chart chart1"></div>
<h1> Monthly </h1>
<div class="ct-chart chart2"></div>
<script >
function load_charts(){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText);
var series = [5, 2, 4, 2, 0] ; // JSON.parse(this.responseText);
var data = { series: [ series ] };
new Chartist.Line('.chart1', data);
}
}
xhttp.open("GET", "/data", true);
xhttp.send();
};
//monthly = new Chartist.Line('.chart2', data);
</script>
<script onload="load_charts();" src="/chartist.min.js.gz"> </script>
</body>
</html>