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

Bugfix: Auto resizing chart when window/parent container expands

parent 76a1f174
No related branches found
No related tags found
2 merge requests!13Saddlegallmidge form idec 372,!12feat: Add test page (spatial) with mapserver layer in openlayers map
......@@ -32,8 +32,8 @@
<select class="form-control" name="weatherStationId" id="weatherStationId"></select>
</div>
<button class="btn btn-primary" type="button" onclick="submitData();">Submit</button>
<div>
<canvas id="resultChart"></canvas>
<div style="aspect-ratio: 2;">
<canvas id="resultChart""></canvas>
</div>
<div id="weatherData" class="table-responsive">
</div>
......@@ -50,6 +50,7 @@
// Page globals
var modelMetaData = undefined;
var weatherDatasource = undefined;
var weatherDatasources = undefined;
var editor = undefined;
const selectList = document.getElementById("weatherStationId");
......@@ -73,6 +74,8 @@
//console.info("Adding weather stations");
// Pull weather stations from web service, render list
weatherDatasource = await getWeatherDatasource("no.nibio.lmt");
weatherDatasources = await getWeatherDatasources();
console.info(weatherDatasources);
stationList = await getWeatherStationList(weatherDatasource);
stationList.sort((a, b) => {
return (a.name < b.name) ? -1 : (a.name > b.name) ? 1 : 0;
......@@ -160,13 +163,14 @@
new Chart(ctx, {
type: "line",
options: {
responsive: true,
scales: {
x: {
type: "time",
time: {
//unit: "day",
diplayFormats: {
day: "YYYY-MM-DD" // This doesn't seem to have any effect
day: "YYYY-MM-DD" // This doesn't seem to have any effect. Why??
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment