start on real code, add fav to remove error, remove sourcemap

This commit is contained in:
Torsten Ruger 2021-06-27 21:44:38 +03:00
parent 345a5ff8bc
commit 477802abac
3 changed files with 22 additions and 19 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

View File

@ -10,25 +10,28 @@
} }
</style> </style>
</head> </head>
<body> <body>
<h1> Weekly </h1> <h1> Weekly </h1>
<div class="ct-chart chart1"></div> <div class="ct-chart chart1"></div>
<h1> Monthly </h1> <h1> Monthly </h1>
<div class="ct-chart chart2"></div> <div class="ct-chart chart2"></div>
<script > <script >
function draw_chart(){ function load_charts(){
var data = { var xhttp = new XMLHttpRequest();
// Our series array that contains series objects or in this case series data arrays xhttp.onreadystatechange = function() {
series: [ if (this.readyState == 4 && this.status == 200) {
[5, 2, 4, 2, 0] console.log(this.responseText);
] var series = [5, 2, 4, 2, 0] ; // JSON.parse(this.responseText);
}; var data = { series: [ series ] };
weekly = new Chartist.Line('.chart1', data); new Chartist.Line('.chart1', data);
monthly = new Chartist.Line('.chart2', data); }
}; }
xhttp.open("GET", "/data", true);
</script> xhttp.send();
<script onload="draw_chart();" src="./chartist.min.js.gz"> </script> };
//monthly = new Chartist.Line('.chart2', data);
</script>
<script onload="load_charts();" src="/chartist.min.js.gz"> </script>
</body> </body>
</html> </html>