Simon Brunel [Mon, 12 Nov 2018 20:15:37 +0000 (21:15 +0100)]
Make bar styling options scriptable (#5780)
The bar `backgroundColor`, `borderColor`, `borderWidth` and `borderSkipped` options are now scriptable (unit tests, docs and a basic sample). Also fix the gulp task that generates the documentation on Windows.
Hendrik Röhm [Thu, 1 Nov 2018 15:26:20 +0000 (16:26 +0100)]
Remove dead and broken code from gulpfile (#5794)
In commit c216c0af76, the task unittestWatch was removed. However, the watch task links to it, when executed with the test flag. As watching the unittest is possible with `gulp unittest --watch`, this code is not needed anymore and thus removed.
Simon Brunel [Sat, 20 Oct 2018 09:38:48 +0000 (11:38 +0200)]
Add support for *.js test fixture config (#5777)
JSON doesn't support functions which are needed to create scriptable options, so implement a very basic method to load a JavaScript file exporting the config in `module.exports`. Also rename test sources (remove the `jasmine.` prefix), cleanup `karma.conf.js` and add an example .js fixture config (bubble radius option).
Added Wicked-Charts to the Popular Extensions Page (#5734)
Wicked-Charts is a Java wrapper around Chart.js and allows users to create charts in Java using the Wicket framework. The latest version of Wicked-Charts (3.1.0) supports Chartjs and Wicket 8.
Colin [Fri, 10 Aug 2018 07:32:35 +0000 (08:32 +0100)]
Event handling to use target instead currentTarget (#5575)
If you attach event handlers to a container rather than directly to the canvas then the currentTarget is the container, event.target is the canvas that triggers the event. It's useful to do this if you have many charts or are creating them dynamically.
Tom Pullen [Wed, 8 Aug 2018 16:52:56 +0000 (17:52 +0100)]
Fix adding and removing datasets in bar samples (#5663)
Account for zero indexing of arrays when creating a name for an added dataset and remove the last dataset in the array when removing a dataset rather than removing the first.
Simon Brunel [Mon, 9 Jul 2018 19:14:25 +0000 (21:14 +0200)]
Add "point style" image tests
Replace the old style canvas "mock" context checks by image based unit tests which are easier to maintain and allow more flexibility in the drawing logic since we are not testing the context calls but the final painted result.
Bring ctx.beginPath() before switch and replace ctx.fillRect()/ctx.strokeRect() with ctx.rect()/ctx.fill() to make it consistent with the other styles. It is also preferable that helpers.canvas.roundedRect() include ctx.closePath() at the end because CanvasRenderingContext2D.rect() closes the subpath.
Get rid of ctx.closePath() for cross, crossRot, star, line and dash because these have no closed path shape, and it should be avoided that ctx.closePath() makes a round-trip path.
Add label for first dataset in progress-bar example (#5625)
While the second dataset already has a label ("My Second dataset") the first dataset showed "undefined" as a label. Added a label to the first dataset object.
Simon Brunel [Tue, 26 Jun 2018 15:58:32 +0000 (17:58 +0200)]
Enhance the rounded rectangle implementation (#5597)
Use `arcTo` instead of `quadraticCurveTo` (both methods have the same compatibility level) because it generates better results when the final rect is a circle but also when it's actually a rectangle and not a square. This change is needed by the datalabels plugin where the user can configure the `borderRadius` and thus generate circle from a rounded rectangle.
Fix responsive in IE11 with padding as percentage (#4620)
When the chart is responsive to the parent container, the calculations for padding assumes that the figure is in pixels so that 20% is taken to be 20 (pixels), which results in the chart exceeding the parent container. This appears to be an IE11 only issue.
jcopperfield [Tue, 20 Feb 2018 23:44:01 +0000 (00:44 +0100)]
Bugfix: Improve polyfill function of log10 to return whole powers of 10 (#5275)
* Bugfix: Improve polyfill function of log10 to return whole powers of 10
as integer values, as it caused endless loop in IE11 in the tick
creation loop.
* Compare floating-point numbers directly instead of using unnecessary division.
Simon Brunel [Thu, 1 Feb 2018 02:35:08 +0000 (03:35 +0100)]
Fix Slack invitation link (#5217)
Setup a new Heroku app based on rauchg/slackin, using Slack legacy token from the Chart.js (chartjs.slack@...) user and reCAPTCHA from the same Google account.
Simon Brunel [Sat, 13 Jan 2018 13:23:50 +0000 (14:23 +0100)]
Fix updating plugin options (#5144)
Cached plugin descriptors hold a reference on the plugin options, which break if the plugin options object is replaced. That case happens when the user updates the plugin options with a new object, but also since the new config update logic (#4198) that now always clones the plugin options. The fix consists in explicitly invalidating that cache before updating the chart.
Simon Brunel [Thu, 11 Jan 2018 08:03:16 +0000 (09:03 +0100)]
Fix GitBook error with the shared ESLint config (#5133)
`gitbook-cli install` failed when trying to fetch eslint-config-chartjs because of the way it was installed (ie. using the GitHub repository URL). The shared config is now published on npmjs: https://www.npmjs.com/package/eslint-config-chartjs
Simon Brunel [Tue, 9 Jan 2018 13:12:40 +0000 (14:12 +0100)]
Rename Chart.layout to Chart.layouts (#5118)
Chart.layouts seems more consistent with other service names (Chart.plugins, Chart.scales, etc.) but also more inline with the service which handle many layout (one per charts).
Simon Brunel [Sat, 6 Jan 2018 22:59:13 +0000 (23:59 +0100)]
Use the Chart.js shared ESLint config (#5112)
An ESLint shareable config has been created (from this repository) in the attempt to homogenize Chart.js hosted projects and plugins style. Rename `.eslintrc` files to `.eslintrc.yml` since the name has been deprecated.
Fix the CC badge (maintainability) and disable CodeClimate ESLint plugin because it doesn't support custom shareable config but also because it already executes relevant checks as part of the regular process.