(section, panel, config)
| 293 | } |
| 294 | |
| 295 | function drawChart(section, panel, config) { |
| 296 | const canvas = $(section, 'canvas'); |
| 297 | const existing = charts.get(panel.id); |
| 298 | if (existing) existing.destroy(); |
| 299 | charts.set(panel.id, new Chart(canvas, config)); |
| 300 | } |
| 301 | |
| 302 | async function drawPanel(panel, request, token) { |
| 303 | const section = document.getElementById(`panel-${panel.id}`); |