Task #102759
closedRemove obsolete configuration option in BarChartWidget to hide label
100%
Description
In TYPO3 12 bar chart widgets now show a label which did not appear in TYPO3 11. But the old configuration option to hide that label is still present. That configuration option should be removed because it does not have any effect.
Example
Example for the widget "Number of errors in system log" provided by EXT:dashboard
Background
In TYPO3 12 the chart.js library which is used to render the widgets in the dashboard has been updated from version 2.9 to 4.0 (https://docs.typo3.org/c/typo3/cms-dashboard/12.4/en-us/Migration/Index.html#migration).
For chart.js 3.0.0 and above the configuration for hiding the label from bar charts has been changed, see https://www.chartjs.org/docs/latest/migration/v3-migration.html:
legend, title and tooltip namespaces were moved from options to options.plugins.
Solution
In EXT:dashboard, file `Classes/Widgets/BarChartWidget.php` remove the code
'legend' => [
'display' => false,
],
from
public function getEventData(): array
{
return [
'graphConfig' => [
'type' => 'bar',
'options' => [
'maintainAspectRatio' => false,
'legend' => [
'display' => false,
],
Just for reference: The correct code to hide the label would be
public function getEventData(): array
{
return [
'graphConfig' => [
'type' => 'bar',
'options' => [
'maintainAspectRatio' => false,
'plugins' => [
'legend' => [
'display' => false,
],
],
Files