1
0
mirror of https://github.com/beestat/app.git synced 2025-05-24 02:14:03 -04:00

Fixed latent issue related to #244

This commit is contained in:
Jon Ziebell 2020-02-23 05:37:04 -05:00
parent ed94987db1
commit 1f3ac41fe1
2 changed files with 16 additions and 12 deletions

View File

@ -94,10 +94,7 @@ beestat.runtime_sensor.get_data = function(thermostat_id, range) {
// Loop.
var current_m = begin_m;
while (
// beestat.cache.runtime_sensor.length > 0 &&
current_m.isSameOrAfter(end_m) === false
) {
while (current_m.isSameOrAfter(end_m) === false) {
data.x.push(current_m.clone());
// Without this series the chart will jump to the nearest value if there is a chunk of missing data.

View File

@ -57,6 +57,21 @@ beestat.component.chart.runtime_sensor_detail_occupancy.prototype.get_options_se
beestat.style.color.lightblue.dark
];
/**
* This chart does not need the entire dummy series, but it does need the
* first series to have *some* non-null data or Highcharts does not find a
* valid point to reference when trying to sync the crosshair between
* series. The easiest way to fix that seems to be throwing a mostly-empty
* series up top.
*/
series.push({
'name': '',
'data': [0],
'yAxis': 0,
'type': 'line',
'lineWidth': 0
});
// Sensors
this.data_.metadata.sensors.forEach(function(sensor, i) {
series.push({
@ -71,14 +86,6 @@ beestat.component.chart.runtime_sensor_detail_occupancy.prototype.get_options_se
});
});
series.push({
'name': '',
'data': self.data_.series.dummy,
'yAxis': 0,
'type': 'line',
'lineWidth': 0
});
return series;
};