add mini static graph, no data, and not working with file anymore. Otherwise good

This commit is contained in:
Torsten 2021-06-25 09:14:06 +03:00
parent d3cd83acc1
commit 345a5ff8bc
3 changed files with 35 additions and 1 deletions

Binary file not shown.

View File

@ -0,0 +1,34 @@
<!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 draw_chart(){
var data = {
// Our series array that contains series objects or in this case series data arrays
series: [
[5, 2, 4, 2, 0]
]
};
weekly = new Chartist.Line('.chart1', data);
monthly = new Chartist.Line('.chart2', data);
};
</script>
<script onload="draw_chart();" src="./chartist.min.js.gz"> </script>
</body>
</html>

View File

@ -25,7 +25,7 @@ String getContentType(String filename){
bool handleFileRead(String path ){
DBG_OUTPUT_PORT.println("handleFileRead: " + path);
if(path.endsWith("/")) path += "index.htm";
if(path.endsWith("/")) path += "index.html";
String contentType = getContentType(path);
String pathWithGz = path + ".gz";
if(LittleFS.exists(pathWithGz) || LittleFS.exists(path)){