fix: bug with multiple charts on same page

Fix #3207
This commit is contained in:
George Cushen committed 2025-08-17 21:06:37 +01:00
1 parent 7722abcd66
commit 9c48341ee8
1 file changed
+6 -6
@@ -12,13 +12,13 @@
{{ $id := delimit (shuffle (seq 1 9)) "" }}
<div id="chart-{{$id}}" class="chart"></div>
<script>
async function fetchChartJSON() {
console.debug('Hugo Blox fetching chart JSON...')
const response = await fetch('{{$json}}');
return await response.json();
}
(function() {
async function fetchChartJSON() {
console.debug('Hugo Blox fetching chart JSON...')
const response = await fetch('{{$json}}');
return await response.json();
}
let a = setInterval( function() {
if ( typeof window.Plotly === 'undefined' ) {
console.debug('Plotly not loaded yet...')