Simon Brunel [Thu, 29 Nov 2018 06:56:20 +0000 (07:56 +0100)]
Deprecate Chart.{Type} classes (#5868)
It looks like these classes are a legacy from version 1 but we actually never promoted their usage. Instead, the regular way to create a chart is to set the type in the config, for example: `new Chart(ctx, {type: 'bar'})`. Some types are actually missing (no `Chart.HorizontalBar` or `Chart.Pie`) but it's also not scalable because it can easily conflict with other classes scoped under the `Chart` namespace.
Akihiko Kusanagi [Wed, 28 Nov 2018 06:53:41 +0000 (14:53 +0800)]
Adjust the size of rectRounded/rectRot point to fit pointRadius (#5858)
- Calculate the vertices of the shapes so that they are inscribed in the circle that has the radius of `pointRadius`
- Remove `translate()` and `rotate()` to fix the regression introduced by #5319
- Refactor `rectRounded` for better performance
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.