From b8dbddf7f41b8343c00f69b0d83cf3d872a6c014 Mon Sep 17 00:00:00 2001 From: "Joseph P. White" Date: Tue, 14 Apr 2020 13:24:48 -0400 Subject: [PATCH] Fix bug in highchart wrapper code. The code tries to shade the legend background when the data in the chart are restricted by roles. This happens e.g. when you have user role and try to plot some supremm data. Pie charts do not have legends so the series.legendItem property is absent. This change makes sure the legend background colour is only changed if there is a legend to change. --- html/gui/js/HighChartWrapper.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/html/gui/js/HighChartWrapper.js b/html/gui/js/HighChartWrapper.js index 3e416f3db3..96b483827f 100644 --- a/html/gui/js/HighChartWrapper.js +++ b/html/gui/js/HighChartWrapper.js @@ -99,11 +99,9 @@ XDMoD.utils.createChart = function (chartOptions, extraHandlers) { for (var i = 0; i < this.series.length; i++) { var series = this.series[i]; - if (!series.options.isRestrictedByRoles) { - continue; + if (series.options.isRestrictedByRoles && series.legendItem) { + this.options.chart.events.helperFunctions.addBackgroundColor(series.legendItem, '#DFDFDF'); } - - this.options.chart.events.helperFunctions.addBackgroundColor(series.legendItem, '#DFDFDF'); } } ],