From ab65eb8e8a01faedfd5dc11560a92a22c5cc087d Mon Sep 17 00:00:00 2001 From: mKainzbauer Date: Tue, 5 Mar 2024 19:28:18 +0100 Subject: [PATCH] fixes https://github.com/brewster76/fuzzy-archer/issues/141 fixes https://github.com/brewster76/fuzzy-archer/issues/144 --- skins/Bootstrap/js/charts.js | 1 + skins/Bootstrap/js/site.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/skins/Bootstrap/js/charts.js b/skins/Bootstrap/js/charts.js index 44ebc53..4d5591d 100644 --- a/skins/Bootstrap/js/charts.js +++ b/skins/Bootstrap/js/charts.js @@ -171,6 +171,7 @@ function getChartOption(seriesConfigs) { let yAxisItem = { name: Array.isArray(unit) && unit.length > 1 ? unit[1] : unit, type: "value", + alignTicks: true, minInterval: minInterval, maxInterval: maxInterval, nameTextStyle: { diff --git a/skins/Bootstrap/js/site.js b/skins/Bootstrap/js/site.js index ff441be..314b4e8 100644 --- a/skins/Bootstrap/js/site.js +++ b/skins/Bootstrap/js/site.js @@ -431,6 +431,9 @@ function appendNewerItems(newerItems) { for (let chartItem of Object.keys(newerItems)) { let chartId = chartItem + CHART; let chart = charts[chartId]; + if(chart === undefined) { + return; + } let option = chart.getOption(); for (let dataset of option.series) { dataset.chartId = chartId; @@ -462,9 +465,11 @@ function getValue(obj, path) { } function getSeriesData(chartItem, seriesName) { - for (let series of charts[chartItem + CHART].getOption().series) { - if (series.weewxColumn !== undefined && series.weewxColumn === seriesName) { - return series.data; + if(charts[chartItem + CHART] !== undefined) { + for (let series of charts[chartItem + CHART].getOption().series) { + if (series.weewxColumn !== undefined && series.weewxColumn === seriesName) { + return series.data; + } } } return undefined;