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,