diff --git a/ipmd/templates/ipmd/saddlegallmidgeform.html b/ipmd/templates/ipmd/saddlegallmidgeform.html index ae1b580c43e7f09475b20625cb51e71823924e98..cc2e680caffae718eb8ca4974dfd099397812e77 100644 --- a/ipmd/templates/ipmd/saddlegallmidgeform.html +++ b/ipmd/templates/ipmd/saddlegallmidgeform.html @@ -99,6 +99,9 @@ var selectList = document.getElementById("weatherStationId"); var weatherData = undefined; + + // Object that will hold the chart. Must be destroyed and recreated if you run the model more than once + let resultChart = undefined; async function initPage() { currentModelMetaData = await getModelMetadata("adas.dss","HAPDMA"); @@ -505,7 +508,11 @@ const ctx = document.getElementById('resultChart'); - new Chart(ctx, { + if(resultChart !== undefined) + { + resultChart.destroy(); + } + resultChart = new Chart(ctx, { type: "line", options: { responsive: true,