This version focuses on improving the interactivity of Chart.js. We have new and improved modes for interacting with the graph. For instance, you can now highlight the nearest item easily. It is also easy to define your own tooltip modes with a few simple functions. See all the new modes in the docs. Data animations when adding and removing data have been improved: points now animate in cleanly by default.
#3356 The default aspect ratio is now correctly applied, meaning that polar, doughnut and radar charts are now rendered with an aspect ratio of 1 (square). The old behavior can be obtained by globally changing the default
aspectRatiofor each chart type (e.g.
Chart.defaults.doughnut.aspectRatio = 2).
- #3201 Expose data points info for custom tooltip. Thanks @bydooweedoo
- #3400 New tooltip and hover interaction modes.
displayColorsoption to turn off tooltip color boxes.
#3453 New tooltip
- #3460 New line chart fill modes.
#3472 Add new
caretYproperties to tooltip point.
- #3474 Charts can now be created from the canvas id.
- #3476 Layout service now supports configurable padding.
#3477 New method to
reset()the chart to its initial state.
tooltips.filteroption to filter tooltip items.
- #3281 Better number formatting for the radial linear scale.
- #3326 Make charts vertically responsive.
- #3364 Inject iframe for responsive charts only.
- #3399 Better animation when adding or removing data.
- #3400 Improve tooltip and hover Interactions.
- #3411 Display tooltip color boxes for all tooltips.
#3417 Expose the
drawBackgroundtooltip method. Thanks @mjeanroy
- #3468 Bar chart performance improvements.
- #3504 Reorganize, cleanup and enhance samples.
- Update installation instructions in README.
- #3133 Skip non finite data points when determining scale sizes. Thanks @bcongdon
#3323 Fix the legend drawing when
- #3324 Compute correct tooltip size when there is no title present.
- #3325 Specifically handle multiline strings for doughnut charts.
- #3341 Fix scale documentation.
- #3356 Fix initial aspect ratio when not responsive.
- #3356 Fix radar default aspect ratio and samples.
- #3357 Fix documentation typos. Thanks @kant
#3358 Fix title overflow by using
fillText()argument. Thanks @dylan-kerr
- #3361 Fix HTML legend string for polar area charts to match doughnut charts.
#3409 Generate ticks using only
stepSizewhen all specified. Thanks @fewstera
- #3421 Fix bubble chart tooltip callback to use correct labels.
- #3443 Properly merge colors for the tooltip labels.
- #3444 Fix documentation comparison table "check" character. Thanks @tiesont
- #3446 Fix tooltip caret position.
- #3474 Prevent exception when an invalid canvas/context/id is provided.
#3490 Add missing tick
autoSkipPaddingoption documentation. Thanks @bretjb
- #3516 Fix a documentation typo. Thanks @varatep
- #3522 Fix code and documentation typos. Thanks @jsoref
- #3527 Fix iframe resize handler when re-attached to DOM.
- Move reverse option for labels to correct section in docs.
- #3281 Refactor ticks generators and formatters.
- #3356 Gulp command switch to run specific test files.
#3414 Fix NPM
watchifydependency. Thanks @fewstera
- #3473 Extend ESLint to unit test.
- #3526 Bump ESLint to v3.x.
More details in the release PR: #3551
This version adds back native bower support. We were able to get a name that matches in case with npm.
bower install chart.js. Huge props to @simonbrunel for getting our build system working and fully automated.
- Support a minimum unit on the time scale. Set
time.minUnitto one of the time scale units to use. #3254 Thanks @ianks
- An issue where a zero width border was incorrectly drawn. #3241 Thanks @Pikamander2
- Fixed an incorrect link in the docs #3280 Thanks @trantorLiu
- Return the correct tooltip labels when 2 category axes are used. #3278 Thanks @etimberg
- Improve performance of the time scale by caching intermediate results. #3211 Thanks @desowin
- Fixed an error when the legend of a pie chart was toggled and there were multiple datasets of different lengths. #3309 Thanks @zachpanz88
This release fixes a number of issues and adds a few small enhancements.
- Documentation improvements to a number of issues. #3110 Thanks @zachpanz88
- Line charts now support monotone cubic interpolation. This is like bezier interpolation, but ensures that the line only changes monoticity at data points. #3086 Thanks @MatthieuRivaud
- When a line chart has only 1 data point, the item is now drawn in the center of the chart. #3044 Thanks @roicos
- Fixed an issue with drawing a line where all points were skipped #3066
- Changed "Data Structure" to "Dataset Structure" in the docs to improve clarity. #3046 Thanks @sibennayak
- Removed deprecated
Chart.pluginServicefrom docs and replace with
Chart.plugins. #3088 Thanks @djhuistra
- Fixed a grammatical error in the docs. #3103 Thanks @laviniaclare
- Added a section to the docs on how to generate patterns for charts. #1323 Thanks @ashiguruma
- The hidden iframe used to detect resizing was focusable during tab. #3090
- The tooltip
itemSortfunction needs to get passed the chart data. #3127 Thanks @vermeeca
- Always use the time scale custom parser #3131 Thanks @Lighnat0r
drawTicks == falsefor a scale, the size of the scale was incorrectly calculated. #2872
- When a category scale was used and there were repeated labels, the chart drew incorrectly. #2994
This release fixes a line drawing bug identified in v2.2.0 along with a few other issues.
- Fixed a line drawing issue when the first or last points were null and the
spanGapsoption was turned on. #3056
- Fixed a typo in the docs #3030
- Fixed a crash when no data existed for a dataset in a doughnut chart #2631
- Recalculate the size of the time scale in the underlying units when the last tick is set. #2560 and #2964
- Fixed a typo in the colors section of the docs #3058 Thanks @benpdavison
New Build System
Starting with v2.2.0-rc.1 Chart.js uses a new build system. We no longer include the checked in files (dist folder) in the repository. When a tagged release is made, a build will occur and will be published on NPM automatically. A huge thanks to @simonbrunel for getting this set up and working.
- New build system #2555
- Adds a new tooltip and hover mode that replicates the
labelmode of Chart.js V1. #2299 Thanks @Mesonyx
- Allow stacked scatter charts #2878 Thanks @mtanda
- Can now manually configure the thickness of a bar in a bar chart. Use a new
barThicknessoption on the correct axis to set the thickness of a bar. #2910 Thanks @Joshuabaker2
- You can now configure the starting angle for radar charts #1012 Thanks @slinhart
- You can now configure the starting angle for polar area charts #524
- Fixed JSHint warnings #2734 Thanks @simonbrunel
- Fixed the tooltip average position calculation #2826
- Allow passing the value property to the time scale
getPixelForValuefunction #2604 #2916
- If no config is passed to the chart, gracefully fail. #2526
spanGapsoption for line chart can now be specified per chart instead of only per dataset
- Polar area charts used to be off center #2708
- Fixed typo in tooltip section of docs #2839
- Fixed scale title display in samples #2848 Thanks @ronaldgrn
- Fixed an issue when the time scale had only one point #2741 Thanks @duerahan
- Fixed an issue with tooltip display when one dataset does not have a value. #2789 Thanks @awallat
- Scale docs linked to wrong session #2859 Thanks @azranel
- Default to a 0 starting point for polar area graphs #2809
- Fixed an issue with pie and doughnut chart hover border clipping #2844 Thanks @neilmacintyre
- Fixed a typo in the docs #2888
- Fixed a typo in the bar chart docs #2897 Thanks @jimkring
- Improve documentation regarding
offsetGridLinesoption #2894 Thanks @moberwasserlechner
- Fix an issue when clicking on the label of a category scale #2802
yAlignwere swapped. #2923 Thanks @jeffesp
- Fix typo in the docs #2936 Thanks @gitname
- Add wikipedia link for DRY acronym #2905 Thanks @shuson
nulllabels affecting tooltips #2875 Thanks @Mesonyx
- Fix docs typo #2961 Thanks @moberwasserlechner
- Fixed an issue with numerical data sent to the chart as strings when the axis was stacked #2915
- Fix an issue when hovering a point on the chart where not all datasets have data. #2990 Thanks @tiagoroldao
- Fix an issue in the docs where the pie chart was difficult to click on #2983 Thanks @sibennayak
- Removed an unused property from the radar chart sample #3027 Thanks @moberwasserlechner
- Correct doc spelling mistakes #3032 Thanks @Neabfi
- Prevent the time scale
getLabelMomentmethod from going out of bounds #3039 Thanks @ianks
stepSizeproperty in docs #3048 Thanks @mdewilde
getElementAtEventcould return more than 1 item #2981, #2884 Thanks @IonutLaceanu
spanGapsoption to work with bezier curves #2812
- Converted legend and title blocks to use plugin system. This means that builds without these could be made
- Allow disabling lines on a per dataset. Use
showLineproperty in the dataset. #2580
- Added a new tooltip callback to all customizing the colors shown. Modify the
labelColorcallback in the tooltip to change the colors. #2657
- Added a way to sort tooltip items using a callback. #2661
- Added new plugin callbacks for:
, and 'afterDatasetsUpdate.
- Plugins can now return
falseto cancel actions. Currently only the
beforeDatasetsUpdateplugin call supports this.
- Added a config callback
onResizethat runs when the chart resizes.
- The on canvas legend can now be placed on the left or the right. Simply add
position: 'right'to the legend config to make this happen. The Horizontal Bar sample includes this.
- The grid lines color option can now be passed an array of colors. #2732
- Fixed an issue where the 'rectRot' point style drew incorrectly. #2607
- Fixed an issue where lines with tension 0 did not animate #2647
- Fixed a crash in the pie-customTooltips sample file #2639
- Fixed an issue where destroying the chart did not stop animations #2613
- Fixed link in Readme to advanced docs section. #2675 Thanks @FROGGS
- Fixed the syntax in the docs scale section. #2673 Thanks @zachpanz88
- Improved importing in Common JS scenarios. #2483
- Fixed issues with points being clipped at the edges. #2278
- Fixed an issue that prevented the legend from rendering. #2697 Thanks @dennybiasiolli
- Fixed an issue where the chart title did not change during
update#2686 Thanks @NoelOConnell
- Fixed an issue with AMD builds #2298 Thanks @sassomedia
- Fixed a typo in the tooltip docs #2724 Thanks @fwolfst
- Fixed an issue with the tooltip font color #2730 Thanks @duerahan
- Fixed an issue with the font family for point labels in the radial linear scale #2739 Thanks @msimulcik
- Fixed an issue with line bezier points that were forced inside the chart area. This affected zoom and pan and caused lines to be distorted