Fix Highcharts dark mode switching (#1861)

* Fix Highcharts dark mode switching

Dark/light mode wasn't getting applied because of empty graph objects in the graphs array. Includes a hack for Highcharts directly mutating the passed theme object on every update() call.
This commit is contained in:
Antti Koponen 2021-04-23 08:39:16 +03:00 committed by GitHub
parent 3f275fd7e4
commit e70158250f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -711,7 +711,13 @@ function worldPie(id, worldSeries, gmSeries) {
}
function updateGraphs() {
for (let graph of graphs) {
const scrollbar = {...Highcharts.theme.scrollbar};
graphs.forEach((graph, index, array) => {
if (Object.keys(graph).length === 0) {
array.splice(index, 1);
return;
}
Highcharts.theme["scrollbar"] = {...scrollbar};
graph.update(Highcharts.theme);
}
}
})
}