-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Description
3.0 final is available
We're proud to announce that Chart.js 3.0.0 is now available. Get it with npm install --save chart.js
Overview
Chart.js 3.0 introduces a number of breaking changes. Chart.js 2.0 was released in April 2016. In the years since then, as Chart.js has grown in popularity and feature set, we've learned some lessons about how to better create a charting library. In order to improve performance, offer new features, and improve maintainability, it was necessary to break backwards compatibility, but we aimed to do so only when worth the benefit. Some major highlights of v3 include:
- Large performance improvements including the ability to skip data parsing and render charts in parallel via webworkers
- Additional configurability and scriptable options with better defaults
- Completely rewritten animation system
- Rewritten filler plugin with numerous bug fixes
- Documentation migrated from GitBook to Docusaurus
- API Documentation generated and verified by TypeScript
- No more CSS injection
- Tons of bug fixes
- Tree shaking
In this issue we'll maintain a list of committed, nice-to-have, and proposed features for v3. Feedback from the community will help shape the prioritization for v3.
Committed Features
Rollup configured for ES6+ babel translation (Add babel plugin for rollup & transform code #6555)Removecustom
(Remove undocumented "custom" feature #6605)- Remove all deprecated code
- Most deprecated code has been removed. However
grep -ri backward src
still returns a handful of results. Also need to search the code for TODOs
- Most deprecated code has been removed. However
Prefix all private methods with underscoreMake ticks objects (Consider making ticks objects #5019)(or not? should we revert? see Remove ticksToTimestamps and change ticks to numbers #6791)Removemoment
frompackage.json
(Remove moment from dependencies #6745), move the moment adapter to an external project, and remove the rollup optional pluginRemovezeroLineIndex
feature and replace with function based axis properties (Remove zeroLineIndex functionality #6697 & Allow functions to be specified for scale grid line options #6700)Change, adopt ES6 classes, userequire
toimport
const
/let
, etc.- Scale cleanup
Change axis options from an array to an object keyed by ID (Convert axis options from arrays to objects #6773)CleanupgetPixelForTick
(getPixelForTick is confusing and possibly inconsistent #6715)
- Performance Improvements
Accept data in a format that doesn't require parsing (Consider new format for passing data in #6696)Improve performance of finding hovered element (Improve hover performance #6716)Split_options
out of_model
. Creating_model
is expensive right now, since it's done for each data point. However,_options
does not need to be recreated for each data point unless scriptable options are being used. Thus by just using_options
directly instead of copying it into_model
we would be much more performant (Rewrite animation logic #6845)Reduce number of objects created (e.g._view
and_model
) when animation is disabled (e.g. Performance optimizations when animations are disabled #6710).
MakebeginAtZero
default betrue
for bar chart (Change scale.beginAtZero default to true #5939)- Cleanup options (Rationalize option names #5233)
- Remove element options and
remove(Global datasets options thought #6684 Remove global from defaults #6893)global
from options namespace Standardize on using degrees for angles (Polar area: startAngle in degrees, 0 at top. #6936)
- Remove element options and
Migrate docs from GitBook to Docusaurus (Migrate from GitBook to Docusaurus #7295)Support tree shaking / individual module imports (v3: consider changing export logic for esm modules #7371)- Leverage index / value concepts
RemovehorizontalBar
and make all charts capable of being horizontal (Replace horizontalBar with indexAxis: 'y' #7144)
Proposed / Nice to Have Features
- Scale cleanups
- Improve the scale interface & document how to use it
- Investigate normalizing
options.scales
andoption.scale
keys for all chart types
- Performance Improvements
- Support drawing charts without creating elements possibly as external chart type (fastline controller #6881)
- When the tooltip and other hover actions are disabled, the chart should not be redrawn when hovering on it. This would make external custom html tooltips massively faster. Along with this, consider making the default tooltip be an external tooltip (Provide out-of-the-box HTML tooltip capability #7195 (comment))
- Make sure the tooltip listener only applies to the chart area and not the whole canvas (Upgrade benchmark to Chart.js 3.0.0-alpha.2 leeoniya/uPlot#277 (comment))
- Cleanup options (Rationalize option names #5233)
Remove overrides of_resolveDataElementOptions
and_resolveDatasetElementOptions
(Option resolution with proxies #8374)Make_dataElementOptions
an array in all controllers (i.e. line and radar). (Option resolution with proxies #8374)Ensure user-specified options are applied after defaults. Delete_config
and have just a single object holding resolved options (Option resolution with proxies #8374)- Make
chart.options
private and immutable (user should not directly edit, but should pass in new config to merge) Cleanup interactions options (Add interaction options #7922)
- Leverage index / value concepts
- Bar / rectangle cleanup (Consider replacing rectangle x/y with index/value #6760)
- Make drawing clearer
- Consider renaming axis
label
to axistitle
to differentiate from the tick labels - Improve log scale tick generation (log scale step size too large #7332)
- Bar chart
- Allow specifying pixels between bars (e.g. 1 px space and fill the rest). Right now it can only be a percentage
- Ideas from @simonbrunel: Chart.js 3.pdf
Won't do
- Can we move hidden elements to plugin? (Remove unnecessary checks for hidden data #6255)
- Split out the time scale into it's own package
- Consider removing
data
from config so that we havedatasets
,labels
, andoptions
as first level properties. We agreed thatdata.datasets.data
is confusing, but every chart would need to be updated if we changed this and all StackOverflow answers would be outdated
How can you help?
- Provide feedback on which issues you would like prioritized for v3
- Test out alpha & beta releases as they become available. The alpha release is quite stable though we have found a few issues. Thanks to the folks that reported them! Here's a list of known issues
- Volunteer time to help improve the project
connecteev, dcworldwide, miyamoto-san, maslianok, JasonTheAdams and 27 moreerrmayank, puka-tchou, brolnickij, Razican, wenfangdu and 4 moreconnecteev, dcworldwide, slaweet, adojck, JasonTheAdams and 13 morebrolnickij, alvarocjunq and iszlailorand