chart no data create new graph bug fixed
This commit is contained in:
parent
46e29680d6
commit
a9635ccdd3
4 changed files with 7 additions and 6 deletions
|
@ -344,7 +344,7 @@ function DrawChart() {
|
|||
((typeof ChartJson.chart[j].data[i] != 'undefined') &&
|
||||
(ChartJson.chart[j].datapoints == datapointsMax)
|
||||
) ||
|
||||
((typeof ChartJson.chart[j].data[i] == 'undefined') &&
|
||||
((ChartJson.chart[j].hasOwnProperty('data')) && (typeof ChartJson.chart[j].data[i] == 'undefined') &&
|
||||
((ChartJson.chart[j].datapoints < datapointsMax) && (datapointsMax - ChartJson.chart[j].datapoints <= i) )
|
||||
)
|
||||
) {
|
||||
|
|
|
@ -335,10 +335,11 @@ function DrawChart() {
|
|||
((typeof ChartJson.chart[j].data[i] != 'undefined') &&
|
||||
(ChartJson.chart[j].datapoints == datapointsMax)
|
||||
) ||
|
||||
((typeof ChartJson.chart[j].data[i] == 'undefined') &&
|
||||
((ChartJson.chart[j].hasOwnProperty('data')) && (typeof ChartJson.chart[j].data[i] == 'undefined') &&
|
||||
((ChartJson.chart[j].datapoints < datapointsMax) && (datapointsMax - ChartJson.chart[j].datapoints <= i) )
|
||||
)
|
||||
) {
|
||||
console.log('chart ' + j + 'data ' + i);
|
||||
/* which element of data[] we want to draw. */
|
||||
var dataIndex = i;
|
||||
/* check if datapoints is smaller then datapointsMax and if the difference between them is the actual dataIndex (i) */
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,8 +4,8 @@
|
|||
<meta charset='UTF-8'>
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
|
||||
<title>Ruderalis 2G - CanGrow v0.2-dev3</title>
|
||||
<link rel='stylesheet' href='/cangrow.css'>
|
||||
<script type='text/javascript' src='/cangrow.js'></script>
|
||||
<link rel='stylesheet' href='cangrow.css'>
|
||||
<script type='text/javascript' src='cangrow.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<ul class='nav'><li><a href='/'>🌱 Ruderalis 2G</a></li>
|
||||
|
@ -109,4 +109,4 @@ gaugeJS_5_2_1.value('52.69', 100, ' %');
|
|||
|
||||
<script type='application/json' id='chartJson'>{"chart":[{"id":0,"name":"BME280 inside","descr":"Temperature","unit":"°C","data":[19.76,19.77,19.6,19.35,19.04,18.83,18.79,18.77,18.79,18.84,18.84,18.84,18.87,18.86,18.81,18.75,18.67,18.62,18.65,19.47,20.98,21.51,21.55,21.59,21.58,21.58,21.61,21.62,21.69,21.68,21.72,21.9,21.85,22.11,22.1,21.93,21.91,21.93,22.01,22.02,22.02,21.97,22.15,22.27,22.29,22.27,22.31,22.32,22.33,22.34,22.39,22.49,22.6,22.81,22.84,22.7,22.59,22.61,22.46,22.38,22.44,21.6,21.66,20.75,20.65,20.14,19.61,19.35,19.33,21.36,21.61,21.75,21.78,21.84,21.89,21.91,21.99,22.02,22.04,22.21,22.18,22.17,22.25,22.29,22.36,22.31,22.29,21.53,20.47,19.99,19.84,19.77,19.69],"timestamp":[1744335791,1744336691,1744337591,1744338491,1744339391,1744340291,1744341191,1744342091,1744342991,1744343891,1744344791,1744345691,1744346591,1744347491,1744348390,1744349290,1744350190,1744351090,1744351990,1744352890,1744353790,1744354690,1744355590,1744356490,1744357390,1744358290,1744359190,1744360090,1744360990,1744361890,1744362790,1744363690,1744364590,1744365490,1744366390,1744367290,1744368190,1744369090,1744369990,1744370890,1744371790,1744372690,1744373591,1744374491,1744375391,1744376291,1744377191,1744378091,1744378991,1744379891,1744380791,1744381691,1744382591,1744383605,1744384505,1744385404,1744386520,1744387420,1744388319,1744389219,1744390119,1744391019,1744391919,1744392819,1744393719,1744394619,1744395519,1744396419,1744397319,1744398219,1744399120,1744400020,1744400920,1744401820,1744402719,1744403619,1744404519,1744405419,1744406319,1744407219,1744408119,1744409019,1744409919,1744410819,1744411719,1744412619,1744413519,1744414419,1744415319,1744416219,1744417119,1744418019,1744419722],"datapoints":93},{"id":1,"name":"BME280 inside","descr":"Humidity","unit":"%","data":[58.83,59.46,59.77,59.56,58.5,57,58.23,61.18,62.2,63.84,64.67,64.58,65.17,64.4,63.22,64.14,62.19,62.53,59.93,58.02,55.12,40.74,40.06,39.86,40.76,40.37,40.66,40.04,40.14,39.6,38.87,38.86,38.54,39.08,39.34,39.18,39.6,39.1,38.79,38.13,38.57,38.43,39.23,39.8,39.78,40.08,40.37,40.18,40.22,40.51,40.17,40.28,40.27,40.19,40.08,40.65,40.83,40.68,41.18,41.28,41.16,41.17,39.72,47.22,56.29,61.11,63.5,64.9,65.93,48.91,45.96,46.25,46.31,46.13,45.4,45.39,44.63,44.42,43.98,43.88,43.85,43.77,45.05,47.06,48.15,49.87,49.32,50.73,57.33,61.43,62.99,63.62,62.37],"timestamp":[1744335791,1744336691,1744337591,1744338491,1744339391,1744340291,1744341191,1744342091,1744342991,1744343891,1744344791,1744345691,1744346591,1744347491,1744348391,1744349291,1744350190,1744351090,1744351990,1744352890,1744353790,1744354690,1744355590,1744356490,1744357390,1744358290,1744359190,1744360090,1744360990,1744361890,1744362790,1744363690,1744364590,1744365490,1744366390,1744367290,1744368190,1744369090,1744369990,1744370890,1744371790,1744372690,1744373591,1744374491,1744375391,1744376291,1744377191,1744378091,1744378991,1744379891,1744380791,1744381691,1744382591,1744383605,1744384505,1744385405,1744386520,1744387420,1744388320,1744389220,1744390120,1744391020,1744391919,1744392819,1744393719,1744394619,1744395519,1744396419,1744397319,1744398219,1744399120,1744400020,1744400920,1744401820,1744402720,1744403620,1744404520,1744405420,1744406320,1744407220,1744408120,1744409020,1744409920,1744410820,1744411720,1744412620,1744413520,1744414420,1744415319,1744416219,1744417119,1744418019,1744419722],"datapoints":93},{"id":2,"name":"SHT30 outside","descr":"Humidity","unit":"%","datapoints":0}]}</script><link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/charts.css/dist/charts.min.css'><div id='chartDiv'><table id='chartTable' class='charts-css line multiple show-data-on-hover show-primary-axis show-6-secondary-axes'><caption>Linechart</caption></table><ul id='chartLegend' class='charts-css legend legend-line'></ul></div><script>DrawChart();</script>
|
||||
|
||||
<div class='footer'><span>Build: 66dd843-esp8266_d1_mini_clone-20250412021530</span></div></div></body></html>
|
||||
<div class='footer'><span>Build: 66dd843-esp8266_d1_mini_clone-20250412021530</span></div></div></body></html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue