1
0
mirror of https://github.com/beestat/app.git synced 2025-06-05 14:48:34 -04:00

Fixed #270 - Make Runtime Summary plot scale configurable

This commit is contained in:
Jon Ziebell 2020-06-22 21:27:33 -04:00
parent 53272ec5b0
commit 014e939547

View File

@ -131,30 +131,32 @@ beestat.component.chart.runtime_thermostat_summary.prototype.get_options_series_
beestat.component.chart.runtime_thermostat_summary.prototype.get_options_yAxis_ = function() { beestat.component.chart.runtime_thermostat_summary.prototype.get_options_yAxis_ = function() {
var y_max_hours; var y_max_hours;
var tick_interval; var tick_interval;
switch (beestat.setting('runtime_thermostat_summary_group_by')) { if (beestat.setting('runtime_thermostat_summary_smart_scale') === true) {
case 'year': switch (beestat.setting('runtime_thermostat_summary_group_by')) {
y_max_hours = 8760; case 'year':
tick_interval = 2190; y_max_hours = 8760;
break; tick_interval = 2190;
case 'month': break;
y_max_hours = 672; case 'month':
tick_interval = 168; y_max_hours = 672;
break; tick_interval = 168;
case 'week': break;
y_max_hours = 168; case 'week':
tick_interval = 24; y_max_hours = 168;
break; tick_interval = 24;
case 'day': break;
y_max_hours = 24; case 'day':
tick_interval = 6; y_max_hours = 24;
break; tick_interval = 6;
break;
}
} }
return [ return [
{ {
'alignTicks': false, 'alignTicks': false,
'min': 0, 'min': 0,
'softMax': (beestat.setting('runtime_thermostat_summary_smart_scale') === true) ? y_max_hours : undefined, 'softMax': y_max_hours,
'tickInterval': tick_interval, 'tickInterval': tick_interval,
'reversedStacks': false, 'reversedStacks': false,
'gridLineColor': beestat.style.color.bluegray.light, 'gridLineColor': beestat.style.color.bluegray.light,