Skip to content

Commit

Permalink
- fix JS issue with non-existing data points. (Sometimes RRDtool retu…
Browse files Browse the repository at this point in the history
…rns a wider timeframe than data points.)
  • Loading branch information
browniebraun committed Feb 2, 2025
1 parent cb8d743 commit ccdad8b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions include/js/jquery.zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -1272,9 +1272,12 @@
for (let key in zoom.raw.legend) {
let dataIndex = key;
dataIndex++;
let value = zoom.raw.data[index][dataIndex];
if (value !== null) {
value = zoomFormatNumToSI(value);
let value = null;
if(zoom.raw.data.hasOwnProperty(index) && zoom.raw.data[index][dataIndex] !== undefined) {
value = zoom.raw.data[index][dataIndex];
if (value !== null) {
value = zoomFormatNumToSI(value);
}
}
zoom.refs.livedata.items[key].value.html(value === null ? 'n/a ' : value);
}
Expand Down

0 comments on commit ccdad8b

Please sign in to comment.