From ed563cf7f973729b2049abb148c038d44adfc989 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Wed, 5 Jan 2022 18:24:32 -0500 Subject: [PATCH] Added aux heat profile --- js/component/chart/temperature_profiles.js | 69 +++++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/js/component/chart/temperature_profiles.js b/js/component/chart/temperature_profiles.js index 669cdbc..6b6963d 100644 --- a/js/component/chart/temperature_profiles.js +++ b/js/component/chart/temperature_profiles.js @@ -57,6 +57,34 @@ beestat.component.chart.temperature_profiles.prototype.get_options_series_ = fun 'states': {'hover': {'lineWidthPlus': 0}} }); + // Trendline data + series.push({ + 'data': this.data_.series.trendline_auxiliary_heat_1, + 'name': 'indoor_auxiliary_heat_1_delta', + 'color': beestat.series.indoor_auxiliary_heat_1_delta.color, + 'marker': { + 'enabled': false, + 'states': {'hover': {'enabled': false}} + }, + 'type': 'line', + 'lineWidth': 2, + 'states': {'hover': {'lineWidthPlus': 0}} + }); + + // Trendline data + series.push({ + 'data': this.data_.series.trendline_auxiliary_heat_2, + 'name': 'indoor_auxiliary_heat_2_delta', + 'color': beestat.series.indoor_auxiliary_heat_2_delta.color, + 'marker': { + 'enabled': false, + 'states': {'hover': {'enabled': false}} + }, + 'type': 'line', + 'lineWidth': 2, + 'states': {'hover': {'lineWidthPlus': 0}} + }); + // Trendline data series.push({ 'data': this.data_.series.trendline_cool_1, @@ -129,6 +157,35 @@ beestat.component.chart.temperature_profiles.prototype.get_options_series_ = fun 'states': {'hover': {'lineWidthPlus': 0}} }); + series.push({ + 'data': this.data_.series.raw_auxiliary_heat_1, + 'name': 'indoor_auxiliary_heat_1_delta_raw', + 'color': beestat.series.indoor_auxiliary_heat_1_delta_raw.color, + 'dashStyle': 'ShortDot', + 'marker': { + 'enabled': false, + 'states': {'hover': {'enabled': false}} + }, + 'type': 'spline', + 'lineWidth': 1, + 'states': {'hover': {'lineWidthPlus': 0}} + }); + + // Raw data + series.push({ + 'data': this.data_.series.raw_auxiliary_heat_2, + 'name': 'indoor_auxiliary_heat_2_delta_raw', + 'color': beestat.series.indoor_auxiliary_heat_2_delta_raw.color, + 'dashStyle': 'ShortDot', + 'marker': { + 'enabled': false, + 'states': {'hover': {'enabled': false}} + }, + 'type': 'spline', + 'lineWidth': 1, + 'states': {'hover': {'lineWidthPlus': 0}} + }); + // Raw data series.push({ 'data': this.data_.series.raw_cool_1, @@ -183,9 +240,13 @@ beestat.component.chart.temperature_profiles.prototype.get_options_series_ = fun * @return {Array} The y-axis options. */ beestat.component.chart.temperature_profiles.prototype.get_options_yAxis_ = function() { + /** + * The 0.25° in either direction forces the chart to pad another degree when + * this close to the boundary. + */ var absolute_y_max = Math.max( - Math.abs(this.data_.metadata.chart.y_min), - Math.abs(this.data_.metadata.chart.y_max) + Math.abs(this.data_.metadata.chart.y_min - 0.25), + Math.abs(this.data_.metadata.chart.y_max + 0.25) ); var y_min = absolute_y_max * -1; @@ -240,6 +301,10 @@ beestat.component.chart.temperature_profiles.prototype.get_options_tooltip_forma 'type': 'string' }) + ' / h'; + if (point.y.toFixed(1) > 0) { + value = '+' + value; + } + if (series.name.indexOf('raw') === -1) { section.push({ 'label': beestat.series[series.name].name,