Skip to content
Snippets Groups Projects
Commit cab27230 authored by Daniel Cothran's avatar Daniel Cothran
Browse files

Issue #3505816: Fix pie chart xaxis labels extraction for chartjs

parent b5b1376a
No related branches found
No related tags found
3 merge requests!133Edit Chartjs.php,!113fixed the issue,!75Resolve #3391197 "Enable support for"
Pipeline #442977 passed with warnings
...@@ -381,6 +381,10 @@ class Chartjs extends ChartBase { ...@@ -381,6 +381,10 @@ class Chartjs extends ChartBase {
foreach ($children as $child) { foreach ($children as $child) {
$type = $element[$child]['#type']; $type = $element[$child]['#type'];
if ($type === 'chart_xaxis' && isset($element[$child]['#labels'])) { if ($type === 'chart_xaxis' && isset($element[$child]['#labels'])) {
if (in_array($element['#chart_type'], $this->getPieStyleTypes())) {
$categories = $element[$child]['#labels'];
break;
}
$categories = is_array($element[$child]['#labels']) ? array_map('strip_tags', $element[$child]['#labels']) : []; $categories = is_array($element[$child]['#labels']) ? array_map('strip_tags', $element[$child]['#labels']) : [];
} }
if (in_array($element['#chart_type'], $this->getPieStyleTypes()) if (in_array($element['#chart_type'], $this->getPieStyleTypes())
...@@ -656,6 +660,7 @@ class Chartjs extends ChartBase { ...@@ -656,6 +660,7 @@ class Chartjs extends ChartBase {
return [ return [
'pie', 'pie',
'doughnut', 'doughnut',
'donut',
'polarArea', 'polarArea',
]; ];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment