*** WIP WIP *** load all charts in advance

This commit is contained in:
rxf
2023-04-04 10:39:13 +02:00
parent 5082eb408f
commit 71a59fb9e8
6 changed files with 56 additions and 58 deletions
+7 -4
View File
@@ -55,17 +55,15 @@ export async function showChart(params, typ, container) {
}
}
const url = `/chart/getsensordata?sensorid=${params.sid}&data=${typ}`
let ret = await fetch(url)
.catch(e => {
logerror(e)
});
let erg = await ret.json()
erg.options.xAxis.labels.formatter = xformat
erg.options.tooltip.formatter = form
let chr = Highcharts.chart(container, erg.options, function (chart) {
let chart = Highcharts.chart(container, erg.options, function (chart) {
utils.addSensorID2chart(chart, {
sid: erg.params.sensorid,
indoor: erg.params.indoor
@@ -79,4 +77,9 @@ export async function showChart(params, typ, container) {
}
}
export const loadAll = async (params) => {
console.log('now load all in Background')
for (let i = 2; i < tabtable.length; i++) {
await showChart(params, tabtable[i].type, tabtable[i].container)
}
}