Skip to content

Releases: chartjs/Chart.js

Version 2.6.0

25 May 14:01
Compare
Choose a tag to compare

Version 2.6 brings better stability, improved documentation, and powerful new features to Chart.js. It's now possible to create advanced area chart thanks to a new filler plugin: stacked area charts can now fill to another dataset in a configurable manner. Check out the samples to see the all the new options.

The time scale internals have been rewritten, improving performance by reducing the number of operations on each tick value. These changes also fixed a number of time scale related issues that users have been experiencing.

Our new documentation has been rewritten using GitBook and reorganized into smaller topics to improve clarity and allow topics to be more intuitively found. The online documentation is now organized by release version going forward: http://www.chartjs.org/docs/{version}/.

Breaking Changes

  • #3782 The lineArc setting for the radial linear scale has been removed and replaced by gridLines.circular and pointLabels.display.
  • #4044 The bar controller internals has been refactored, therefore custom chart types that extend from the bar controller will need to be updated. More details can be found in this PR.

Deprecations

  • #3839 Chart.chart has been merged in Chart.
  • #3839 Chart.Controller has been merged in Chart.
  • #3959 Chart.Animation.animationObject has been merged in Chart.Animation.
  • #3959 Chart.Animation.chartInstance has been removed, use Chart.Animation.chart instead.
  • #4008 'zero', 'top', 'bottom' fill modes has been replaced by 'origin', 'start', 'end'.

New Features

  • #3599 New option to control the tooltip caret padding.
  • #3782 New option to handle displaying point labels on a radar chart.
  • #3782 New option to control if the lines appear as circles or straight lines.
  • #3812, #4094 Layout service now supports item ordering (item.weigth).
  • #3872 Added support for drawing tooltip borders. Thanks @marcelotedeschi
  • #3926 Added dataset update and draw plugin hooks.
  • #3963 Max bar thickness is now configurable. Thanks @seven7seven
  • #4008 Added support to fill between datasets.
  • #4019 New option for dashed 0 lines on axes. Thanks @lndobryden
  • #4065 Added before and after functionality to the steppedLine option. Thanks @ericnkatz

Enhancements

  • #2043 Added documentation for high performance charting.
  • #2325 Updated documentation for extending chart types.
  • #2362 Added documentation for multi-chart and multi-axis.
  • #2386 Updated documentation for custom tooltips implementation.
  • #3274, #3299 Improved documentation on axis range settings.
  • #3662 Added documentation for extending scales.
  • #3751 Documentation has been fully rewritten and is now based on Gitbook.
  • #3826 Improved performance for time scale label parsing. Thanks @tredston.
  • #3893 Improved axis default positions so that x axes default to bottom and y axes default to left.
  • #3897 Chart data can now be entirely replaced using chart.data = {...}.
  • #3960 Improved element transitioning by removing color exceptions.
  • #4034 Tooltips with no content are not anymore drawn. Thanks @samueljo
  • #4043, #4153 Added a showcase page for samples.
  • #4078 Added a better error message when the chart type is incorrect.
  • #3914 Time scale internals improved to be simpler and more efficient. Thanks @tredston
  • #4166 Enhanced the responsive documentation.
  • #4167 Made it clear that labels need to be specified when using a category axis on a line chart.
  • #4170 Added documentation for updating data.
  • #4178 Reorganize extension docs. Thanks @benmccann
  • #4183 Removed unnecessary variable. Thanks @benmccann

Issues Fixed

  • #2481 chart instanceof Chart now returns true.
  • #3118 Fixed documentation for scatter chart.
  • #3237 Fixed getElementAtEvent() return type documentation.
  • #3490 Added documentation for axes autoSkipPadding option.
  • #3585 Fixed stacked bar charts with log axes.
  • #3792 Fixed stacked bar displaying NaN when all datasets are hidden. Thanks @Jareechang
  • #3842 Removed trailing ':' in tooltip label when dataset label is undefined.
  • #3856 Tooltip callbacks were called on mouse move even if data did not change. Thanks @Jareechang
  • #3883 Fixed deprecated Chart.PluginBase definition.
  • #3860 Correctly handle decimal canvas display size.
  • #3899 Grouped bars that are not stacked are now displayed correctly. Thanks @potatopeelings
  • #3909 Avoid fails from server-side renderings. Thanks @khorolets
  • #3911 Fixed missing onComplete animation argument and updated associated doc.
  • #3945 Fixed use of native reserved keyword as a parameter name.
  • #3960 Fixed element initial implicit transition.
  • #4032 Radar chart are now centered horizontally. Thanks @shirosaki
  • #4039 Fixed line-customTooltips.html example scroll offset. Thanks @el-ee
  • #4062 Fixed misplaced data points on category scale. Thanks @martinzuern
  • #4064 Fixed scale min and max when dataset contains no values. Thanks @GabrielMancik
  • #4086 Fixed pointRadius and pointHitRadius config for radar charts.
  • #4100 Updated the documentation bar chart example to begin at zero.
  • #4105 Ensured that scale width cannot be greater than maxWidth. Thanks @tredston
  • #4140 Fixed shorthand legend: false and title: false.
  • #4149, #4155 Fixed and merged contributing documentation. Thanks @benmccann
  • #4165 Fixed failing instanceof when reading context from iframe or a protected environment.
  • #4192 Fixed legend and title layout options update.
  • #4254 Fixed images being used as a pointStyle not rendering at custom dimensions

Development

  • #3839 Added unit tests for deprecations.
  • #3986 Cleaned up and upgraded unit tests environment.
  • #3988 Introduced unit test based on image comparison.
  • #4075 Refactored gulp coverage task in gulp unittest --coverage.
  • #4076 Moved legend and title in the plugins folder.
  • #4222 Removed executable bit from js files. Thanks @benmccann

More details in the release PR: #4236

Version 2.5.0

08 Feb 20:26
Compare
Choose a tag to compare

Version 2.5 brings some exciting new features to Chart.js. Now, configuration options can be updated at runtime (with some exceptions) just by changing the chart.config.options object and calling chart.update().

More powerful plugins that can be added to an individual chart (instead of globally), but also disabled on a per chart basis. This gives you fine grained control over when plugins interact with your charts. The plugins were changed to support cancelling actions by returning false from any before* plugin calls.

Two new extensions have been added: beforeEvent and afterEvent, respectively called before and after the chart responds to an input event such as a mousemove or a click. The plugin is passed a wrapped version of the event, that implements IEvent.

Breaking Changes

  • #3570 Removed unused Chart.helpers.cancelAnimFrame method.
  • #3669 onHover callback now has 3 parameters. The 2nd parameter is the event that triggered the hover. This was done for consistency with the onClick callback.

Deprecations

  • #3819 IPlugin.afterScaleUpdate: use IPlugin.afterLayout hook instead.
  • #3819 Extending Chart.PlugingBase is not anymore required and is strongly discouraged, instead create/register plugins using plain JavaScript objects (see this example).

New Features

  • #2060 Chart options can now be updated at runtime.
  • #2643 Stacked bar charts now support groupings into smaller stacks. Thanks @potatopeelings
  • #3335 Plugins can now be specified per chart.

Enhancements

  • #1933 Legends can now be hidden dynamically by a plugin at runtime based on the chart size.
  • #2873, #3491, #3506 Chart elements are clipped when outside the chart area. Thanks @KoyoSE
  • #3208 Slow performance using moment.js. Thanks @tredston
  • #3225 Multiple lines of text are now supported in radar chart labels
  • #3514 Add rectRounded point style. Thanks @cmoel
  • #3818 Removed useless initialization steps to improve performance

Issues Fixed

  • #2478 Large x axis labels created odd gaps in the chart
  • #2780 Bar chart when data is 0. Thanks @KoyoSE
  • #2879, #3354 Rotated labels caused issues on the category axis
  • #3141 Axis width incorrectly used ticks.padding option when measuring
  • #3199 Line Chart border width of 0 was ignored.
  • #3412 Long y axis tick text was cutoff
  • #3381 Infinite loop when in certain cases when generating logarithmic ticks.
  • #3387 Fixed legend text alignment
  • #3408 Monotone cubic interpolation broke when two adjacent points had the same x value
  • #3528 null data caused incorrect tooltips for the time scale. Thanks @Jareechang
  • #3585 Logarithmic stacked bar charts don't draw the first dataset
  • #3589 Wrong category size of bars when x axis has min and max options. Thanks @KoyoSE
  • #3591 Correct radar chart tension settings
  • #3592 Correct radar chart documentation name for point radius setting
  • #3603 Fix crash in dataset interaction mode
  • #3605 Documentation for x-axis interaction mode was incorrect. Thanks @weareoutman
  • #3607 Correct link in animation section of documentation. Thanks @38elements
  • #3618 Tooltip label is incorrect on Bar chart when min is defined. Thanks @KoyoSE
  • #3685 bug when calculating if steps fit into scale as a whole number. Thanks @Tarqwyn
  • #3713 Axis label was cutoff when axis was at top of chart. Thanks @KoyoSE
  • #3717 Removed jQuery code from samples. Thanks @KoyoSE
  • #3739 Incorrect use of animation options in doughnut chart docs. Thanks @NtsDK
  • #3741 Axis labels placed incorrectly when axis is at the top of the chart. Thanks @KoyoSE
  • #3763 Pie charts incorrectly calculated the inner radius when cutout percentage was 0.
  • #3772 Fix incorrect anchor link in docs. Thanks @mdewilde
  • #3788 Fixed docs for using Chart.js with CommonJS and ES6 imports. Thanks @Jareechang
  • #3801 Ignore .gitignore file for Bower

Development

  • #3610 Updated documentation for plugin renames. Thanks @compwright
  • #3635 Upgrade to gulp-uglify v2.0.0 to improve build speed. Thanks @jeffcarey
  • #3718, #3795 Refactoring to move platform specific code into it's own module. The ultimate goal is to allow builds for non browser platforms

More details in the release PR: #3840

Version 2.4.0

12 Nov 17:58
Compare
Choose a tag to compare

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.

Breaking Changes

  • #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 aspectRatio for each chart type (e.g. Chart.defaults.doughnut.aspectRatio = 2).

New Features

  • #3201 Expose data points info for custom tooltip. Thanks @bydooweedoo
  • #3400 New tooltip and hover interaction modes.
  • #3411 New displayColors option to turn off tooltip color boxes.
  • #3453 New tooltip average and nearest positioning modes.
  • #3460 New line chart fill modes.
  • #3472 Add new caretX and caretY properties 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.
  • #3494 New tooltips.filter option to filter tooltip items.

Enhancements

  • #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 drawBackground tooltip method. Thanks @mjeanroy
  • #3468 Bar chart performance improvements.
  • #3504 Reorganize, cleanup and enhance samples.
  • Update installation instructions in README.

Issues Fixed

  • #3133 Skip non finite data points when determining scale sizes. Thanks @bcongdon
  • #3323 Fix the legend drawing when labels.usePointStyle is true.
  • #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 maxWidth fillText() argument. Thanks @dylan-kerr
  • #3361 Fix HTML legend string for polar area charts to match doughnut charts.
  • #3409 Generate ticks using only min, max and stepSize when 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.
  • #3450 Fix options.events option merging.
  • #3474 Prevent exception when an invalid canvas/context/id is provided.
  • #3490 Add missing tick autoSkipPadding option 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.

Development

  • #3281 Refactor ticks generators and formatters.
  • #3356 Gulp command switch to run specific test files.
  • #3414 Fix NPM watchify dependency. Thanks @fewstera
  • #3473 Extend ESLint to unit test.
  • #3526 Bump ESLint to v3.x.

More details in the release PR: #3551

Version 2.3.0

22 Sep 19:03
Compare
Choose a tag to compare

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.

New Features

  • Support a minimum unit on the time scale. Set time.minUnit to one of the time scale units to use. #3254 Thanks @ianks

Issues Fixed

  • 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

Development

More details in the release PR: #3321

Version 2.2.2

27 Aug 12:36
Compare
Choose a tag to compare

This release fixes a number of issues and adds a few small enhancements.

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

Bug Fixes

  • 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.pluginService from 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 itemSort function needs to get passed the chart data. #3127 Thanks @vermeeca
  • Always use the time scale custom parser #3131 Thanks @Lighnat0r
  • When drawTicks == false for 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

Version 2.2.1

30 Jul 17:07
Compare
Choose a tag to compare

This release fixes a line drawing bug identified in v2.2.0 along with a few other issues.

Bug Fixes

  • Fixed a line drawing issue when the first or last points were null and the spanGaps option 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

Version 2.2.0

28 Jul 22:28
Compare
Choose a tag to compare

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.

This change means that installing via bower needs to use the bower npm resolver. Detailed instructions can be found in the docs

Enhancements

  • New build system #2555
  • Adds a new tooltip and hover mode that replicates the label mode 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 barThickness option 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

Issues Fixed

  • Fixed JSHint warnings #2734 Thanks @simonbrunel
  • Fixed the tooltip average position calculation #2826
  • Allow passing the value property to the time scale getPixelForValue function #2604 #2916
  • If no config is passed to the chart, gracefully fail. #2526
  • spanGaps option 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 offsetGridLines option #2894 Thanks @moberwasserlechner
  • Fix an issue when clicking on the label of a category scale #2802
  • Tooltip xAlign and yAlign were swapped. #2923 Thanks @jeffesp
  • Fix typo in the docs #2936 Thanks @gitname
  • Add wikipedia link for DRY acronym #2905 Thanks @shuson
  • Fix null labels 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 getLabelMoment method from going out of bounds #3039 Thanks @ianks
  • Duplicate stepSize property in docs #3048 Thanks @mdewilde
  • getElementAtEvent could return more than 1 item #2981, #2884 Thanks @IonutLaceanu
  • Fixed spanGaps option to work with bezier curves #2812

Version 2.1.6

14 Jun 23:33
Compare
Choose a tag to compare

Fixes an issue identified in V2.1.5 where returning arrays from tooltip callbacks was broken. #2775

Version 2.1.5

12 Jun 17:41
Compare
Choose a tag to compare

Deprecations

  • #2752 Chart.pluginService has been renamed to Chart.plugins.

Enhancements

  • #2580 Allow disabling lines on a per dataset. Use showLine property in the dataset.
  • #2657 Added a new tooltip callback to all customizing the colors shown. Modify the labelColor callback in the tooltip to change the colors.
  • #2661 Added a way to sort tooltip items using a callback.
  • #2732 The grid lines color option can now be passed an array of colors.
  • Converted legend and title blocks to use plugin system. This means that builds without these could be made.
  • New plugin hooks: resize, beforeDatasetsDraw, afterDatasetsDraw, beforeDatasetsUpdate, and afterDatasetsUpdate.
  • Plugins can now return false to cancel actions. Currently only the beforeDatasetsUpdate plugin call supports this.
  • Added a config callback onResize that 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.

Issues Fixed

  • #2607 Fixed an issue where the 'rectRot' point style drew incorrectly.
  • #2613 Fixed an issue where destroying the chart did not stop animations.
  • #2639 Fixed a crash in the pie-customTooltips sample file.
  • #2647 Fixed an issue where lines with tension 0 did not animate.
  • #2673 Fixed the syntax in the docs scale section. Thanks @zachpanz88
  • #2675 Fixed link in Readme to advanced docs section. Thanks @FROGGS
  • #2278 Fixed issues with points being clipped at the edges.
  • #2483 Improved importing in Common JS scenarios.
  • #2686 Fixed an issue where the chart title did not change during update. Thanks @NoelOConnell
  • #2697 Fixed an issue that prevented the legend from rendering. Thanks @dennybiasiolli
  • #2298 Fixed an issue with AMD builds. Thanks @sassomedia
  • #2724 Fixed a typo in the tooltip docs. Thanks @fwolfst
  • #2730 Fixed an issue with the tooltip font color. Thanks @duerahan
  • #2739 Fixed an issue with the font family for point labels in the radial linear scale. 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

Version 2.1.4

26 May 23:00
Compare
Choose a tag to compare

This release adds a new call that plugins can use afterScaleUpdate which is useful for performing actions that require the scales to be in their final sizes.

Enhancements

  • Performance and minification improvements. See #2491 #2545 #2549 #2551 #2578 #2612 Thanks to @simonbrunel and @niemyjski for their help with performance improvements.
  • Provide default tooltip callback implementations for horizontal bar charts #2536
  • Added bubble chart docs #2594
  • Added a new setting, gridLines.drawBorder to allow hiding the border along the edge of an axis. #2574 Thanks @ceane
    Documentation files have been improved for basic configuration and axes. See #2625

Issues Fixed

  • Fixed horizontal bar outline #2537
  • Fixed line tension docs #2535
  • Fixed a syntax error in a sample #2568 Thanks @niemyjski
  • Error when the first data point for a chart using a time scale was null #2519
  • Fix an issue where the last tick overlapped. #2589 Thanks @haschu
  • Fix an issue with bar widths when there are a lot of bars. #2216
  • Fix an issue with scatter lines charts when the X value is passed as a moment js object. #2588 Thanks @AllenJB
  • Fixed an issue with the doughnut doc labels. #2406
  • Doc did not have a note about selecting the correct build #2288
  • Null data affected tooltip position #2567
  • Documentation chart colours were inconsistent. #2593