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
Updated by Gerrit Code Review 11 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82402
Updated by Gerrit Code Review 11 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82385
Updated by Oliver Bartsch 11 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset a31ae2c12b3844134c4442a1afe57ae1c9a9166f.