See discussion in the issue for context and possible approaches. When invoking update() inside an event handler, such as onHover, `options.hover.animationDuration` was not being respected. Given that some use cases may require additional animation properties for the manual update call, this commit changes that method signature to accept a configuration object. This object provides backwards compatibility with duration and lazy properties, and also introduces the easing property so that the event animation is different from the global one. Add tests that guarantee that when update is called manually with arguments, it properly builds the _bufferedRequest or calls render with the proper arguments. It includes test cases for when update is called with legacy arguments (duration and lazy) instead of the config object. .update() documentation was previously updated but .render() was left out. Since the backwards compatible change was also made to render(), this commit adds documentation for it.
Chart.js
Simple HTML5 Charts using the canvas element chartjs.org
Installation
You can download the latest version of Chart.js from the GitHub releases or use a Chart.js CDN.
To install via npm:
npm install chart.js --save
To install via bower:
bower install chart.js --save
Selecting the Correct Build
Chart.js provides two different builds that are available for your use. The Chart.js and Chart.min.js files include Chart.js and the accompanying color parsing library. If this version is used and you require the use of the time axis, Moment.js will need to be included before Chart.js.
The Chart.bundle.js and Chart.bundle.min.js builds include Moment.js in a single file. This version should be used if you require time axes and want a single file to include, select this version. Do not use this build if your application already includes Moment.js. If you do, Moment.js will be included twice, increasing the page load time and potentially introducing version issues.
Documentation
You can find documentation at www.chartjs.org/docs. The markdown files that build the site are available under /docs. Previous version documentation is available at www.chartjs.org/docs/#notes-previous-versions.
Contributing
Before submitting an issue or a pull request, please take a moment to look over the contributing guidelines first. For support using Chart.js, please post questions with the chartjs tag on Stack Overflow.
Building
Instructions on building and testing Chart.js can be found in the documentation.
Thanks
- BrowserStack for allowing our team to test on thousands of browsers.
- @n8agrin for the Twitter handle donation.
License
Chart.js is available under the MIT license.