mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-05 16:04:03 +01:00
* put borderOpts in own object * document z option * remove todo and change scaleId to id * update some tests * clean bit, remove console log * fix failing test * lint * Remove comment
1.8 KiB
1.8 KiB
4.x Migration Guide
Chart.js 4.0 introduces a number of breaking changes. We tried keeping the amount of breaking changes to a minimum. For some features and bug fixes it was necessary to break backwars compatibility, but we aimed to do so only when worth the benefit.
End user migration
Charts
- Charts don't override the default tooltip callbacks, so all chart types have the same-looking tooltips.
Options
A number of changes were made to the configuration options passed to the Chart constructor. Those changes are documented below.
Specific changes
- The radialLinear grid indexable and scriptable options don't decrease the index of the specified grid line anymore.
- The
destroyplugin hook has been removed and replaced withafterDestroy. - Ticks callback on time scale now receives timestamp instead of a formatted label.
scales[id].grid.drawBorderhas been renamed toscales[id].border.display.scales[id].grid.borderWidthhas been renamed toscales[id].border.width.scales[id].grid.borderColorhas been renamed toscales[id].border.color.scales[id].grid.borderDashhas been renamed toscales[id].border.dash.scales[id].grid.borderDashOffsethas been renamed toscales[id].border.dashOffset.- The z index for the border of a scale is now configurable instead of being 1 higher as the grid z index.
- Linear scales now add and subtracts
5%of the max value to the range if the min and max are the same instead of1. - If the tooltip callback returns
undefined, then the default callback will be used.
Type changes
- The order of the
ChartMetaparameters have been changed from<Element, DatasetElement, Type>to<Type, Element, DatasetElement>.
General
- Removed fallback to
fontColorfor the legend text and strikethrough color.