mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-11 10:58:57 +01:00
parent
9ccbda0ebd
commit
b87208a649
@ -711,13 +711,23 @@ function worldPie(id, worldSeries, gmSeries) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateGraphs() {
|
function updateGraphs() {
|
||||||
|
// HighCharts nukes the scrollbar variable from the given parameter
|
||||||
|
// If the graph doesn't support srollbars (bar, pie and map charts for example)
|
||||||
|
// This workaround stores a copy of the scrollbar so that it can be set
|
||||||
const scrollbar = {...Highcharts.theme.scrollbar};
|
const scrollbar = {...Highcharts.theme.scrollbar};
|
||||||
graphs.forEach((graph, index, array) => {
|
|
||||||
|
function updateGraph(graph, index, array) {
|
||||||
|
// Empty objects can be left in the array if existing graph is re-rendered
|
||||||
if (Object.keys(graph).length === 0) {
|
if (Object.keys(graph).length === 0) {
|
||||||
array.splice(index, 1);
|
array.splice(index, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Highcharts.theme["scrollbar"] = {...scrollbar};
|
|
||||||
|
// scrollbar workaround
|
||||||
|
if (!Highcharts.theme["scrollbar"]) Highcharts.theme["scrollbar"] = {...scrollbar};
|
||||||
|
|
||||||
graph.update(Highcharts.theme);
|
graph.update(Highcharts.theme);
|
||||||
})
|
}
|
||||||
|
|
||||||
|
graphs.forEach(updateGraph);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user