From ef2ba2427afb7ef84782a9eaaaee72b20e70a2b4 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Sat, 22 Feb 2020 15:38:01 -0500 Subject: [PATCH] Fixed lost tooltip on Temperature Profiles from #244 --- js/component/chart.js | 21 +++++++++++++++------ js/component/chart/temperature_profiles.js | 1 + 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/js/component/chart.js b/js/component/chart.js index 4dfacd8..05c8f22 100644 --- a/js/component/chart.js +++ b/js/component/chart.js @@ -387,12 +387,7 @@ beestat.component.chart.prototype.get_options_xAxis_ = function() { }, 'formatter': this.get_options_xAxis_labels_formatter_() }, - 'crosshair': { - 'width': this.get_options_xAxis_crosshair_width_(), - 'zIndex': 100, - 'color': 'rgba(255, 255, 255, 0.2)', - 'snap': this.get_options_xAxis_crosshair_snap_() - }, + 'crosshair': this.get_options_xAxis_crosshair_(), 'events': { 'afterSetExtremes': function() { self.dispatchEvent('after_set_extremes'); @@ -401,6 +396,20 @@ beestat.component.chart.prototype.get_options_xAxis_ = function() { }; }; +/** + * Get the crosshair. + * + * @return {object} The crosshair. + */ +beestat.component.chart.prototype.get_options_xAxis_crosshair_ = function() { + return { + 'width': this.get_options_xAxis_crosshair_width_(), + 'zIndex': 100, + 'color': 'rgba(255, 255, 255, 0.2)', + 'snap': this.get_options_xAxis_crosshair_snap_() + }; +}; + /** * Get the crosshair width. * diff --git a/js/component/chart/temperature_profiles.js b/js/component/chart/temperature_profiles.js index 0259084..35e6f84 100644 --- a/js/component/chart/temperature_profiles.js +++ b/js/component/chart/temperature_profiles.js @@ -244,6 +244,7 @@ beestat.component.chart.temperature_profiles.prototype.get_options_xAxis_ = func }, 'formatter': this.get_options_xAxis_labels_formatter_() }, + 'crosshair': this.get_options_xAxis_crosshair_(), 'plotLines': [ { 'color': beestat.series.outdoor_temperature.color,