diff --git a/js/beestat/runtime_sensor.js b/js/beestat/runtime_sensor.js index 0f7232a..04aeac8 100644 --- a/js/beestat/runtime_sensor.js +++ b/js/beestat/runtime_sensor.js @@ -16,8 +16,6 @@ beestat.runtime_sensor.get_data = function(thermostat_id, range) { 'metadata': { 'series': {}, 'chart': { - 'y_min': Infinity, - 'y_max': -Infinity, 'sensors': null } } diff --git a/js/beestat/runtime_thermostat.js b/js/beestat/runtime_thermostat.js index 9a69fe3..57f41a3 100644 --- a/js/beestat/runtime_thermostat.js +++ b/js/beestat/runtime_thermostat.js @@ -15,18 +15,7 @@ beestat.runtime_thermostat.get_data = function(thermostat_id, range) { 'series': {}, 'metadata': { 'series': {}, - 'chart': { - 'y_min': Infinity, - 'y_max': -Infinity - } - } - }; - - // A couple private helper functions for manipulating the min/max y values. - var y_min_max = function(value) { - if (value !== null) { - data.metadata.chart.y_min = Math.min(data.metadata.chart.y_min, value); - data.metadata.chart.y_max = Math.max(data.metadata.chart.y_max, value); + 'chart': {} } }; @@ -185,7 +174,6 @@ beestat.runtime_thermostat.get_data = function(thermostat_id, range) { data.series.outdoor_temperature.push(outdoor_temperature_moving); data.metadata.series.outdoor_temperature.data[current_m.valueOf()] = beestat.temperature(runtime_thermostat.outdoor_temperature); - y_min_max(outdoor_temperature_moving); data.metadata.series.outdoor_temperature.active = true; var outdoor_humidity_moving = beestat.runtime_thermostat.get_average_( @@ -211,7 +199,6 @@ beestat.runtime_thermostat.get_data = function(thermostat_id, range) { data.series.indoor_temperature.push(indoor_temperature); data.metadata.series.indoor_temperature.data[current_m.valueOf()] = indoor_temperature; - y_min_max(indoor_temperature); data.metadata.series.indoor_temperature.active = true; /** @@ -228,9 +215,6 @@ beestat.runtime_thermostat.get_data = function(thermostat_id, range) { ); data.series.setpoint_heat.push(setpoint_heat); data.metadata.series.setpoint_heat.data[current_m.valueOf()] = setpoint_heat; - y_min_max(outdoor_temperature_moving); - - y_min_max(setpoint_heat); data.metadata.series.setpoint_heat.active = true; @@ -247,7 +231,6 @@ beestat.runtime_thermostat.get_data = function(thermostat_id, range) { ); data.series.setpoint_cool.push(setpoint_cool); data.metadata.series.setpoint_heat.data[current_m.valueOf()] = setpoint_cool; - y_min_max(setpoint_cool); data.metadata.series.setpoint_cool.active = true; diff --git a/js/component/chart/runtime_thermostat_detail_temperature.js b/js/component/chart/runtime_thermostat_detail_temperature.js index 0f68482..35925dd 100644 --- a/js/component/chart/runtime_thermostat_detail_temperature.js +++ b/js/component/chart/runtime_thermostat_detail_temperature.js @@ -121,35 +121,19 @@ beestat.component.chart.runtime_thermostat_detail_temperature.prototype.get_opti * @return {Array} The y-axis options. */ beestat.component.chart.runtime_thermostat_detail_temperature.prototype.get_options_yAxis_ = function() { - /** - * Highcharts doesn't seem to respect axis behavior well so just overriding - * it completely here. - */ - - var y_min = Math.floor((this.data_.metadata.chart.y_min) / 10) * 10; - var y_max = Math.ceil((this.data_.metadata.chart.y_max) / 10) * 10; - var tick_positions = []; - var tick_interval = (beestat.setting('temperature_unit') === '°F') ? 10 : 5; - var current_tick_position = - Math.floor(y_min / tick_interval) * tick_interval; - while (current_tick_position <= y_max) { - tick_positions.push(current_tick_position); - current_tick_position += tick_interval; - } - return [ // Temperature { 'gridLineColor': beestat.style.color.bluegray.light, 'gridLineDashStyle': 'longdash', + 'allowDecimals': false, 'title': {'text': null}, 'labels': { 'style': {'color': beestat.style.color.gray.base}, 'formatter': function() { return this.value + beestat.setting('temperature_unit'); } - }, - 'tickPositions': tick_positions + } }, // Humidity