chart roughly working with chartscss lib.
it will be necessary to put all data into json api endpoint or javascript array. drawing so many <tr></td> tags with style --start --end just kills ESPs ram.
This commit is contained in:
parent
d3d5809763
commit
f601dfd7cd
5 changed files with 10 additions and 10 deletions
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
|
||||
#ifndef CANGROW_VER
|
||||
#define CANGROW_VER "0.2-dev2"
|
||||
#define CANGROW_VER "0.2-dev3"
|
||||
#endif
|
||||
#ifndef CANGROW_BUILD
|
||||
#define CANGROW_BUILD "0420"
|
||||
|
|
|
@ -537,13 +537,13 @@ char* Char_Timestamp_yyyymmdd(const unsigned long timestamp) {
|
|||
snprintf(tmp_day, sizeof(tmp_day), "%d", day(timestamp));
|
||||
}
|
||||
|
||||
if(minute(timestamp) < 10) {
|
||||
snprintf(tmp_minute, sizeof(tmp_minute), "0%d", minute(timestamp));
|
||||
} else {
|
||||
snprintf(tmp_minute, sizeof(tmp_minute), "%d", minute(timestamp));
|
||||
}
|
||||
//if(minute(timestamp) < 10) {
|
||||
//snprintf(tmp_minute, sizeof(tmp_minute), "0%d", minute(timestamp));
|
||||
//} else {
|
||||
//snprintf(tmp_minute, sizeof(tmp_minute), "%d", minute(timestamp));
|
||||
//}
|
||||
|
||||
snprintf(tmp_timestamp, sizeof(tmp_timestamp), "%d%s%s%s", year(), tmp_month, tmp_day, tmp_minute);
|
||||
snprintf(tmp_timestamp, sizeof(tmp_timestamp), "%d%s%s", year(), tmp_month, tmp_day);
|
||||
|
||||
return tmp_timestamp;
|
||||
}
|
||||
|
|
|
@ -811,7 +811,7 @@ void LFS_Chart_Rotate_Data(const byte chartId) {
|
|||
|
||||
/* timestamp of the oldest file allowed. Anything older gets deleted. convert to unsigned long */
|
||||
|
||||
unsigned long timestampOldest = strtoul(Char_Timestamp_yyyymmdd(now() - (5 * Timescale(TIMESCALE_MINUTE))), NULL, 0);
|
||||
unsigned long timestampOldest = strtoul(Char_Timestamp_yyyymmdd(now() - (5 * Timescale(TIMESCALE_DAY))), NULL, 0);
|
||||
|
||||
char chartDirPath[10];
|
||||
snprintf(chartDirPath, sizeof(chartDirPath), "%s%d", CHART_BASE_PATH, chartId);
|
||||
|
|
|
@ -61,6 +61,6 @@ void TimeR_Init() {
|
|||
timer.setInterval(1000, Timer_Output);
|
||||
timer.setInterval(1000, Timer_Sensor);
|
||||
timer.setInterval(100, Timer_Control);
|
||||
timer.setInterval(5000, Timer_3s);
|
||||
timer.setInterval(15*60*1000, Timer_3s);
|
||||
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ String Proc_WebPage_root(const String& var) {
|
|||
String html;
|
||||
|
||||
/* FOR TESTING ONLY - INCLUDE EXTERNAL CSSCHARTS*/
|
||||
html += F("<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/charts.css/dist/charts.min.css'><style>#chart0 { width: 100%%; max-width: 300px; margin: 0 auto;}</style>");
|
||||
html += F("<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/charts.css/dist/charts.min.css'><style>#chart0 { width: 100%%; max-width: 640px; margin: 0 auto;}</style>");
|
||||
html += F("<div id='chart0'><table class='charts-css line'>");
|
||||
if(config.grow.dashboard.chartConfigured[0] == true) {
|
||||
char chartDirPath[10];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue