diff --git a/sd-card/html/data.html b/sd-card/html/data.html
index c14a0a53b..a592241cc 100644
--- a/sd-card/html/data.html
+++ b/sd-card/html/data.html
@@ -5,6 +5,7 @@
body {
height: 100%;
margin: 2px;
+ font-family: Arial, Helvetica, sans-serif;
}
.box {
@@ -33,19 +34,22 @@
+ Todays Data
+ Last part of Todays Data
Loading Data file, please wait...
diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html
index bb970e9c2..d2ff52be9 100644
--- a/sd-card/html/edit_config_param.html
+++ b/sd-card/html/edit_config_param.html
@@ -462,9 +462,6 @@ {
+ // handle the response
+ if (response.status == 404) {
+ firework.launch("No log data available for " + dateString, 'warning', 10000);
+ }
+ response.text()
+ .then( result => {
+ var lines = result.split("\n");
+ var traceValue = { x: [], y: [], type: 'scatter', line: {width: 6}, name: 'Value'};
+ var tracePreValue = { x: [], y: [], type: 'scatter', line: {width: 2}, name: 'Previous Value', visible: 'legendonly'};
+ var traceChangeRate = { x: [], y: [], type: 'bar', yaxis: 'y2', opacity: 0.2, name: 'Change Rate'};
+ var traceChangeAbsolute = { x: [], y: [], type: 'bar', yaxis: 'y2', opacity: 0.2, name: 'Change Absolute', visible: 'legendonly'};
+
+ var timex = 1;
+ for (let line of lines) {
+ {
+ //console.log(line);
+ if (line.split(",")[1] == numbername)
+ {
+ var value = line.split(",")[3];
+ var preValue = line.split(",")[4];
+ var changeRate = line.split(",")[5];
+ var changeAbsolute = line.split(",")[6];
+ var time = line.split(",")[0];
+ //console.log("> "+time+" "+value+"\n");
+
+ traceValue.x.push(time);
+
+ traceValue.y.push(value);
+ tracePreValue.y.push(preValue);
+ traceChangeRate.y.push(changeRate);
+ traceChangeAbsolute.y.push(changeAbsolute);
+ }
+ }
+ }
+ //console.log(trace);
+
+ // Copy time to all traces
+ tracePreValue.x = traceValue.x;
+ traceChangeRate.x = traceValue.x;
+ traceChangeAbsolute.x = traceValue.x;
+
+ //console.log(traceValue.y);
+
+ var offsetValue = traceValue.y[0];
+ var offsetPreValue = tracePreValue.y[0];
+
+ if (showRrelativeValues) {
+ traceValue.y.forEach(function(part, index, arr) {
+ arr[index] = arr[index] - offsetValue;
+ });
+
+ tracePreValue.y.forEach(function(part, index, arr) {
+ arr[index] = arr[index] - offsetPreValue;
+ });
+ }
+
+ // console.log(traceValue.x)
+
+ var data = [traceValue, tracePreValue, traceChangeRate, traceChangeAbsolute];
+
+ var layout = {
+ showlegend: true,
+ colorway: ['green', 'black', 'blue', 'black'],
+
+ yaxis: {title: 'Value'},
+ yaxis2: {
+ title: 'Change',
+ overlaying: 'y',
+ side: 'right'
+ },
+
+ margin: {
+ l: 50,
+ r: 50,
+ b: 50,
+ t: 50,
+ pad: 4
+ },
+
+ legend: {
+ x: 0.2,
+ y: 0.9,
+ xanchor: 'right'
+ }
+ };
+
+ document.getElementById("chart").innerHTML = "";
+ Plotly.newPlot('chart', data, layout, {displayModeBar: true});
+ });
+ }).catch((error) => {
+ // handle the error
+ console.log(error);
+ });
}
@@ -23,67 +121,16 @@
-
+ Data Graph
+
-
-
+
+
+ |
+
-
-
-
-