Skip to content
Snippets Groups Projects
Commit e9e578af authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Merge branch 'saddlegallmidge-form-idec-372' into 'feature/gridv-6-mapserver-layer'

Recreate chart on subsequent model runs

See merge request !16
parents e66570a5 b4c5b687
No related branches found
No related tags found
2 merge requests!16Recreate chart on subsequent model runs,!12feat: Add test page (spatial) with mapserver layer in openlayers map
...@@ -99,6 +99,9 @@ ...@@ -99,6 +99,9 @@
var selectList = document.getElementById("weatherStationId"); var selectList = document.getElementById("weatherStationId");
var weatherData = undefined; 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() { async function initPage() {
currentModelMetaData = await getModelMetadata("adas.dss","HAPDMA"); currentModelMetaData = await getModelMetadata("adas.dss","HAPDMA");
...@@ -505,7 +508,11 @@ ...@@ -505,7 +508,11 @@
const ctx = document.getElementById('resultChart'); const ctx = document.getElementById('resultChart');
new Chart(ctx, { if(resultChart !== undefined)
{
resultChart.destroy();
}
resultChart = new Chart(ctx, {
type: "line", type: "line",
options: { options: {
responsive: true, responsive: true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment