*** WIP WIP *** load all charts in advance
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user