Chart.js v2.5.0 Release Notes

Release Date: 2017-02-08 // about 7 years ago
  • 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