Commit 4695b268 authored by Daniel Cothran's avatar Daniel Cothran Committed by Daniel Cothran
Browse files

Issue #3266028 by andileco: Chartjs pie and donut charts should have different...

Issue #3266028 by andileco: Chartjs pie and donut charts should have different colors to make the charts more readable
parent 8b6a5a51
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -409,6 +409,9 @@ class Chartjs extends ChartBase {
          }
          $dataset->backgroundColor = $element[$key]['#color'];
        }
        if (in_array($chart_type, ['pie', 'doughnut']) && !empty($element['#colors'])) {
          $dataset->backgroundColor = $element['#colors'];
        }

        $series_type = isset($element[$key]['#chart_type']) ? $this->populateChartType($element[$key]) : $chart_type;
        $dataset->type = $series_type;