From 658af158d21e7da45296520ef200e94f6ceb97d6 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Thu, 23 May 2019 20:51:46 -0400 Subject: [PATCH] Fixed #119 While I have the connectNulls option left disabled, I was not adding null values to the series. So Highcharts was just connecting the values because it didn't know any better. --- js/component/card/recent_activity.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/js/component/card/recent_activity.js b/js/component/card/recent_activity.js index 6b82151..2b3c1b1 100644 --- a/js/component/card/recent_activity.js +++ b/js/component/card/recent_activity.js @@ -1098,6 +1098,17 @@ beestat.component.card.recent_activity.prototype.get_series_ = function() { self.y_min_ = Math.min(self.y_min_, setpoint_value_heat); self.y_max_ = Math.max(self.y_max_, setpoint_value_heat); } + } else { + + /** + * Explicitly add a null entry to force an empty spot on the line. + * Otherwise Highcharts will connect gaps (see #119). + */ + series.setpoint_heat.data[x] = null; + series.setpoint_heat.chart_data.push([ + x, + null + ]); } if ( @@ -1115,6 +1126,17 @@ beestat.component.card.recent_activity.prototype.get_series_ = function() { self.y_min_ = Math.min(self.y_min_, setpoint_value_cool); self.y_max_ = Math.max(self.y_max_, setpoint_value_cool); } + } else { + + /** + * Explicitly add a null entry to force an empty spot on the line. + * Otherwise Highcharts will connect gaps (see #119). + */ + series.setpoint_cool.data[x] = null; + series.setpoint_cool.chart_data.push([ + x, + null + ]); } // Indoor temperature