1
0
mirror of https://github.com/beestat/app.git synced 2025-05-24 02:14:03 -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() {
var y_max_hours;
var tick_interval;
switch (beestat.setting('runtime_thermostat_summary_group_by')) {
case 'year':
y_max_hours = 8760;
tick_interval = 2190;
break;
case 'month':
y_max_hours = 672;
tick_interval = 168;
break;
case 'week':
y_max_hours = 168;
tick_interval = 24;
break;
case 'day':
y_max_hours = 24;
tick_interval = 6;
break;
if (beestat.setting('runtime_thermostat_summary_smart_scale') === true) {
switch (beestat.setting('runtime_thermostat_summary_group_by')) {
case 'year':
y_max_hours = 8760;
tick_interval = 2190;
break;
case 'month':
y_max_hours = 672;
tick_interval = 168;
break;
case 'week':
y_max_hours = 168;
tick_interval = 24;
break;
case 'day':
y_max_hours = 24;
tick_interval = 6;
break;
}
}
return [
{
'alignTicks': false,
'min': 0,
'softMax': (beestat.setting('runtime_thermostat_summary_smart_scale') === true) ? y_max_hours : undefined,
'softMax': y_max_hours,
'tickInterval': tick_interval,
'reversedStacks': false,
'gridLineColor': beestat.style.color.bluegray.light,