Fixed empty dataset not added in Chart at createGraph

This commit is contained in:
l_samenv
2024-08-27 11:19:50 +02:00
parent 6c14ac330e
commit 2a9aba5b97
2 changed files with 14 additions and 12 deletions

View File

@ -458,15 +458,17 @@ let graphs = (function (){
for(let e of data.graph[key]){
pdata.push({x: e[0]*1000, y: e[1]});
}
if(pdata.length > 0){
addDataset(gindex, key, pdata, dict[key])
/*console.log(timeRange);
if(data[data.length-1].x-data[0].x > d && data[data.length-1].x-data[0].x < (30*60+10)*1000){ // Adjust to requested time
d = data[data.length-1].x-data[0].x
max = data[data.length-1].x;
min = data[0].x;
}*/
}
// if(pdata.length > 0){
// addDataset(gindex, key, pdata, dict[key])
// /*console.log(timeRange);
// if(data[data.length-1].x-data[0].x > d && data[data.length-1].x-data[0].x < (30*60+10)*1000){ // Adjust to requested time
// d = data[data.length-1].x-data[0].x
// max = data[data.length-1].x;
// min = data[0].x;
// }*/
// }
}
graph.setMinMax(currentMinTime,currentMaxTime);
graph.autoScaleIf();

View File

@ -98,7 +98,7 @@ class InfluxDataGetter:
variable_name_for_query = var_param[0]
parameter = "value" if len(var_param) == 1 else var_param[1]
curve = self._get_curve(variable_name_for_query, parameter, time, interval)
if len(curve) > 0:
# if len(curve) > 0:
res[variable] = curve
return res