diff --git a/src/driver/drv_charts.c b/src/driver/drv_charts.c index dc9ef5545..820daeecb 100644 --- a/src/driver/drv_charts.c +++ b/src/driver/drv_charts.c @@ -371,7 +371,7 @@ void Chart_DisplayLabel(float *val, time_t *time, void *userData) { poststr(request, ","); } request->userCounter++; - snprintf(buffer, sizeof(buffer), "new Date(%ld * 1000).toLocaleTimeString()", (long)(*time)); + snprintf(buffer, sizeof(buffer), "%ld", (long)(*time)); // don't transmit too much data, use only the timestamps here and handle conversion later .... poststr(request, buffer); } void Chart_DisplayData(float *val, time_t *time, void *userData) { @@ -404,26 +404,48 @@ void Chart_Display(http_request_t *request, chart_t *s) { } } - poststr(request, ""); +/* + // on every "state" request, JS code will be loaded and canvas is redrawn + // this leads to a flickering graph + // so put this right below the "state" div + // with a "#ifdef + // drawback : We need to take care, if driver is loaded and canvas will be displayed only on a reload of the page + // or we might try and hide/unhide it ... + poststr(request, ""); poststr(request, ""); - +*/ + poststr(request, ""); + for (int i = 0; i < s->numVars; i++) { + hprintf255(request, ""); + } poststr(request, ""); poststr(request, ""); +// }; + +#endif + // Shared UI elements poststr(request, "
");