View Issue Details

IDProjectCategoryView StatusLast Update
0034847mantisbtreportspublic2024-11-14 16:36
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Target Version2.28.0Fixed in Version2.28.0 
Summary0034847: Upgrade chart.js library to 3.9.1
Description

The MantisGraph plugin currently relies on chart.js library since release 2.0.0. The initial implementation used chart.js 2.1.6, which was updated several times until 2.9.4 (see #28529).

chart.js 3.0.0 came out in 2021 and the latest 3.x release is 3.9.1 (August 2022).

There is also a 4.x branch, but the migration path is not straightforward so we'll upgrade one step at a time.

Additional Information

https://www.chartjs.org/docs/3.9.1/getting-started/v3-migration.html

TagsNo tags attached.

Relationships

related to 0034848 resolveddregad MantisGraph: view all data values when hovering over line 

Activities

Related Changesets

MantisBT: master 499e9ee3

2024-10-12 04:39

dregad


Details Diff
Update chart.js to 3.9.1

Fixes 0034847
Affected Issues
0034847
mod - library/README.md Diff File
mod - plugins/MantisGraph/MantisGraph.php Diff File
rm - plugins/MantisGraph/files/Chart-2.9.4.min.js Diff
add - plugins/MantisGraph/files/chart-3.9.1.min.js Diff File

MantisBT: master 3538b980

2024-10-12 04:43

dregad


Details Diff
Update chart.js colorschemes plugin to 0.5.4

The plugin's official repository seems unmaintained for several years,
and the latest 0.4.0 release is not compatible with Chart.js v3, so we
are switching to a community-maintained fork [1].

Fixes 0034847

[1]: https://github.com/MaximBelov/chartjs-plugin-colorschemes/
Affected Issues
0034847
mod - library/README.md Diff File
mod - plugins/MantisGraph/MantisGraph.php Diff File
rm - plugins/MantisGraph/files/chartjs-plugin-colorschemes-0.4.0.min.js Diff
add - plugins/MantisGraph/files/chartjs-plugin-colorschemes-0.5.4.min.js Diff File

MantisBT: master 322cbcbf

2024-10-12 05:31

dregad


Details Diff
Chart.js v3 compatibility fixes

Following 3.x Migration Guide [1]:
- global namespace was removed from defaults
- xAxes and yAxes arrays were removed
- horizontalBar chart type was removed

Fixes 0034847

[1]: https://www.chartjs.org/docs/3.9.1/migration/v3-migration.html
Affected Issues
0034847
mod - plugins/MantisGraph/files/MantisGraph.js Diff File

MantisBT: master ab8fbc4a

2024-10-12 05:34

dregad


Details Diff
Adjusting pie chart aspect ratio

This avoids the canvas to be resized vertically to a size bigger than
the bar char displayed next to it.

https://www.chartjs.org/docs/3.9.1/configuration/responsive.html

Fixes 0034847
Affected Issues
0034847
mod - plugins/MantisGraph/files/MantisGraph.js Diff File

MantisBT: master 3fb491c5

2024-10-12 12:59

dregad


Details Diff
Fix custom colors for status pie chart

For some reason, the colorscheme plugin's colors are overriding the
custom colors we applied on the datasets (to reflect the standard status
colors from MantisBT config).

As a workaround we now define our status colors as a custom color scheme
instead.

Fixes 0034847
Affected Issues
0034847
mod - plugins/MantisGraph/files/MantisGraph.js Diff File

MantisBT: master fa96f439

2024-10-12 13:45

dregad


Details Diff
Fix and improve fill color for Issue Trends chart

With chart.js 3.x, datasets' fill attribute is false by default.

This restores the fill color, with the following change:
- "Resolved" dataset is filled from the x axis
- "Opened" dataset (= the total) is filled from the Resolved dataset (to
avoid overlap)
- Remove fill color for the "Still open" dataset since it's the delta
from the other 2 sets it makes more sense to only display the line.

Fixes 0034847
Affected Issues
0034847
mod - plugins/MantisGraph/files/MantisGraph.js Diff File

MantisBT: master 172386d6

2024-10-14 06:36

dregad


Details Diff
Issue Trend chart: y axis adjustments

- Regression: y axis no longer starts at 0 - caused by
scales.[x/y]Axes.ticks.beginAtZero renamed to scales[id].beginAtZero
- Set precision = 0 to avoid ticks with decimal values

Fixes 0034847
Affected Issues
0034847
mod - plugins/MantisGraph/files/MantisGraph.js Diff File

MantisBT: master bbcd0a96

2024-10-14 06:37

dregad


Details Diff
Restore interpolation

Decreasing the Bézier curves' tension factor from 0.4 default to 0.2.

Fixes 0034847
Affected Issues
0034847
mod - plugins/MantisGraph/files/MantisGraph.js Diff File

MantisBT: master da8699c0

2024-10-16 13:38

dregad


Details Diff
Use a stacked y axis for Issue Trend chart

The modified visualization introduced in commit fa96f4399fc9c2f84bba815fcc230585087af525
was confusing, due to the `Still open` dataset being the delta of
`Reported` - `Resolved`.

We now display the areas under the `resolved` and `still open` datasets
as stacked data. Since the sum of the 2 is equal to the `reported` set,
its line overlaps and we avoid confusing display.

Fixes 0034847
Affected Issues
0034847
mod - plugins/MantisGraph/files/MantisGraph.js Diff File

MantisBT: master fd682a2b

2024-11-14 16:25

atrol


Details Diff
Fix broken graphs on systems with case-sensitive file systems

Regression introduced when upgrading chart.js library
Reproducible only with default setting $g_cdn_enabled = OFF;

Issue 0034847
Affected Issues
0034847
mod - plugins/MantisGraph/MantisGraph.php Diff File