diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2021-09-03 18:41:25 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2021-09-03 18:41:25 +0200 |
commit | 542b564cb6860ef77ff0f88c58d38a954142b730 (patch) | |
tree | 5aecb082fe833e02264abfc6e6b801802c599f2f /src | |
parent | 4bcf9f9be38aa8b14990cf5a147d7b80f1ce4ab7 (diff) |
Update to Plotly.js 2.4
This includes some changes to import D3 ourselves.
Diffstat (limited to 'src')
-rw-r--r-- | src/munin-plot.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/munin-plot.js b/src/munin-plot.js index f04ee44..29bfa2c 100644 --- a/src/munin-plot.js +++ b/src/munin-plot.js @@ -219,9 +219,9 @@ $(document).ready(function () { })) // update legend const columns = $(plot.legendbyfield[field]).find('td') - columns[2].textContent = (isNaN(minvalue) || !isFinite(minvalue)) ? '-' : Plotly.d3.format('.4s')(minvalue) - columns[3].textContent = (isNaN(avgvalue) || !isFinite(avgvalue)) ? '-' : Plotly.d3.format('.4s')(avgvalue) - columns[4].textContent = (isNaN(maxvalue) || !isFinite(maxvalue)) ? '-' : Plotly.d3.format('.4s')(maxvalue) + columns[2].textContent = (isNaN(minvalue) || !isFinite(minvalue)) ? '-' : d3.format('.4s')(minvalue) + columns[3].textContent = (isNaN(avgvalue) || !isFinite(avgvalue)) ? '-' : d3.format('.4s')(avgvalue) + columns[4].textContent = (isNaN(maxvalue) || !isFinite(maxvalue)) ? '-' : d3.format('.4s')(maxvalue) }) } @@ -233,7 +233,7 @@ $(document).ready(function () { const [amin, amax] = plot.layout.xaxis.range url += '?start=' + amin.substring(0, 16).replace(' ', 'T') + '&end=' + amax.substring(0, 16).replace(' ', 'T') } - Plotly.d3.csv(url, function (data) { + d3.csv(url).then(function (data) { // clear traces Object.keys(plot.tracebyfield).forEach(function (field) { plot.tracebyfield[field].x = [] |