Changed endpoints and db queries, chart now shows suggested mins and maxes

This commit is contained in:
Daniel Ledda
2020-11-07 01:21:33 +01:00
parent 607b82272e
commit 9dbe7c0897

View File

@@ -22,9 +22,7 @@
urlEndpoint += "since/" + pathname.slice(pathname.lastIndexOf("/") + 1);
}
const data = await fetch(urlEndpoint);
const newData = transformData(await data.json());
console.log(pathname, newData);
return newData;
return transformData(await data.json());
}
async function initChart() {
@@ -75,8 +73,8 @@
id: 'y-axis-1',
ticks: {
fontColor: co2Color,
suggestedMin: 400,
suggestedMax: 1100,
min: 400,
max: 1100,
},
}, {
type: 'linear',
@@ -85,8 +83,8 @@
id: 'y-axis-2',
ticks: {
fontColor: tempColor,
suggestedMin: 10,
suggestedMax: 35,
min: 10,
max: 35,
},
gridLines: {
drawOnChartArea: false,
@@ -98,8 +96,8 @@
id: 'y-axis-3',
ticks: {
fontColor: humidityColor,
suggestedMin: 15,
suggestedMax: 85,
min: 15,
max: 85,
},
gridLines: {
drawOnChartArea: false,