mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-23 17:47:38 +01:00
parent
9ccbda0ebd
commit
b87208a649
@ -711,13 +711,23 @@ function worldPie(id, worldSeries, gmSeries) {
|
||||
}
|
||||
|
||||
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};
|
||||
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) {
|
||||
array.splice(index, 1);
|
||||
return;
|
||||
}
|
||||
Highcharts.theme["scrollbar"] = {...scrollbar};
|
||||
|
||||
// scrollbar workaround
|
||||
if (!Highcharts.theme["scrollbar"]) Highcharts.theme["scrollbar"] = {...scrollbar};
|
||||
|
||||
graph.update(Highcharts.theme);
|
||||
})
|
||||
}
|
||||
|
||||
graphs.forEach(updateGraph);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user