State of Chart.js & V3.0
See original GitHub issue3.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 (#6555)Removecustom
(https://github.com/chartjs/Chart.js/pull/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 (https://github.com/chartjs/Chart.js/issues/5019)(or not? should we revert? see https://github.com/chartjs/Chart.js/pull/6791)Removemoment
frompackage.json
(https://github.com/chartjs/Chart.js/pull/6745), move the moment adapter to an external project, and remove the rollup optional pluginRemovezeroLineIndex
feature and replace with function based axis properties (https://github.com/chartjs/Chart.js/pull/6697 & https://github.com/chartjs/Chart.js/pull/6700)Change, adopt ES6 classes, userequire
toimport
const
/let
, etc.- Scale cleanup
Change axis options from an array to an object keyed by ID (https://github.com/chartjs/Chart.js/pull/6773)CleanupgetPixelForTick
(https://github.com/chartjs/Chart.js/issues/6715)
- Performance Improvements
Accept data in a format that doesn’t require parsing (https://github.com/chartjs/Chart.js/issues/6696)Improve performance of finding hovered element (https://github.com/chartjs/Chart.js/issues/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 (https://github.com/chartjs/Chart.js/pull/6845)Reduce number of objects created (e.g._view
and_model
) when animation is disabled (e.g. https://github.com/chartjs/Chart.js/pull/6710).
MakebeginAtZero
default betrue
for bar chart (https://github.com/chartjs/Chart.js/issues/5939)- Cleanup options (https://github.com/chartjs/Chart.js/issues/5233)
- Remove element options and
remove(https://github.com/chartjs/Chart.js/issues/6684 https://github.com/chartjs/Chart.js/pull/6893)global
from options namespace Standardize on using degrees for angles (https://github.com/chartjs/Chart.js/pull/6936)
- Remove element options and
Migrate docs from GitBook to Docusaurus (https://github.com/chartjs/Chart.js/pull/7295)Support tree shaking / individual module imports (https://github.com/chartjs/Chart.js/issues/7371)- Leverage index / value concepts
RemovehorizontalBar
and make all charts capable of being horizontal (https://github.com/chartjs/Chart.js/pull/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 (https://github.com/chartjs/Chart.js/pull/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 (https://github.com/chartjs/Chart.js/issues/7195#issuecomment-598996746)
- Make sure the tooltip listener only applies to the chart area and not the whole canvas (https://github.com/leeoniya/uPlot/pull/277#issuecomment-663021669)
- Cleanup options (https://github.com/chartjs/Chart.js/issues/5233)
Remove overrides of_resolveDataElementOptions
and_resolveDatasetElementOptions
(https://github.com/chartjs/Chart.js/pull/8374)Make_dataElementOptions
an array in all controllers (i.e. line and radar). (https://github.com/chartjs/Chart.js/pull/8374)Ensure user-specified options are applied after defaults. Delete_config
and have just a single object holding resolved options (https://github.com/chartjs/Chart.js/pull/8374)- Make
chart.options
private and immutable (user should not directly edit, but should pass in new config to merge) Cleanup interactions options (https://github.com/chartjs/Chart.js/issues/7922)
- Leverage index / value concepts
- Bar / rectangle cleanup (https://github.com/chartjs/Chart.js/issues/6760)
- Make drawing clearer
- Consider renaming axis
label
to axistitle
to differentiate from the tick labels - Improve log scale tick generation (https://github.com/chartjs/Chart.js/issues/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? (https://github.com/chartjs/Chart.js/pull/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
Issue Analytics
- State:
- Created 4 years ago
- Reactions:62
- Comments:105 (65 by maintainers)
Top Results From Across the Web
API | Chart.js
Reset the chart to its state before the initial animation. A new animation can then be triggered using update . myLineChart.reset();.
Read more >3.x Migration Guide - Chart.js
Chart.js 3.0 introduces a number of breaking changes. ... Polar area startAngle option is now consistent with Radar , 0 is at top...
Read more >Step-by-step guide - Chart.js
Step-by-step guide. Follow this guide to get familiar with all major concepts of Chart.js: chart types and elements, datasets, customization ...
Read more >Updating Charts - Chart.js
When the chart data or options are changed, Chart.js will animate to the new data values and options. # Adding or Removing Data....
Read more >Interactions - Chart.js
interaction , the global interaction configuration is at Chart.defaults.interaction . To configure which events trigger chart interactions, see ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The first release candidate, v3.0.0-rc was released today.
@boddunan its getting close. I think #8332 is probably the last breaking change. There will most likely be one more beta and one or more release canditates before release.