mirror of
https://github.com/beestat/app.git
synced 2025-06-01 04:37:12 -04:00
Sorted sensor detail tooltip by temperature descending
This commit is contained in:
parent
f1b472a8da
commit
a062361137
@ -238,6 +238,7 @@ beestat.component.chart.runtime_sensor_detail_temperature.prototype.get_options_
|
|||||||
var value;
|
var value;
|
||||||
var group;
|
var group;
|
||||||
var color;
|
var color;
|
||||||
|
var point_value;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
point.series_code.includes('calendar_event')
|
point.series_code.includes('calendar_event')
|
||||||
@ -252,12 +253,14 @@ beestat.component.chart.runtime_sensor_detail_temperature.prototype.get_options_
|
|||||||
color = point.color;
|
color = point.color;
|
||||||
if (point.value === undefined) {
|
if (point.value === undefined) {
|
||||||
value = '-';
|
value = '-';
|
||||||
|
point_value = 0;
|
||||||
} else {
|
} else {
|
||||||
value = beestat.temperature({
|
value = beestat.temperature({
|
||||||
'temperature': point.value,
|
'temperature': point.value,
|
||||||
'convert': false,
|
'convert': false,
|
||||||
'units': true
|
'units': true
|
||||||
});
|
});
|
||||||
|
point_value = point.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
var occupancy_key = point.series_code.replace('temperature', 'occupancy');
|
var occupancy_key = point.series_code.replace('temperature', 'occupancy');
|
||||||
@ -269,10 +272,16 @@ beestat.component.chart.runtime_sensor_detail_temperature.prototype.get_options_
|
|||||||
groups[group].push({
|
groups[group].push({
|
||||||
'label': label,
|
'label': label,
|
||||||
'value': value,
|
'value': value,
|
||||||
'color': color
|
'color': color,
|
||||||
|
'point_value': point_value
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Sort sensor data by temperature descending.
|
||||||
|
groups.data.sort(function(a, b) {
|
||||||
|
return b.point_value - a.point_value;
|
||||||
|
});
|
||||||
|
|
||||||
if (
|
if (
|
||||||
groups.mode.length === 0 &&
|
groups.mode.length === 0 &&
|
||||||
groups.data.length === 0
|
groups.data.length === 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user