Skip to content

Commit

Permalink
Fix bug in highchart wrapper code.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jpwhite4 committed Apr 14, 2020
1 parent 95b8c4c commit b8dbddf
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions html/gui/js/HighChartWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
],
Expand Down

0 comments on commit b8dbddf

Please sign in to comment.