Skip to content

Commit

Permalink
fixes #141
Browse files Browse the repository at this point in the history
fixes #144
  • Loading branch information
mKainzbauer committed Mar 5, 2024
1 parent 03984cf commit ab65eb8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions skins/Bootstrap/js/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
11 changes: 8 additions & 3 deletions skins/Bootstrap/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ab65eb8

Please sign in to comment.