Commit Graph

2594 Commits

Author SHA1 Message Date
Akihiko Kusanagi
c84d249035 Fix test failures on Windows (#5872) 2018-11-29 21:05:36 +01:00
Akihiko Kusanagi
ecfa7b24c6 Add support for CanvasPattern and CanvasGradient in tooltip (#5869) 2018-11-29 13:52:56 +01:00
Simon Brunel
aa652df240
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.
2018-11-29 07:56:20 +01:00
Akihiko Kusanagi
d6ac7d8a80 Fix cut off tick labels in radial scale (#5848)
Fix the issue that the topmost tick label and the bottom of the chart area are cut off with a radial scale.
2018-11-28 08:35:15 +01:00
jedrekdomanski
bbca2fc789 Enhance documentation for bar specific scale options (#5854) 2018-11-28 07:56:41 +01:00
Akihiko Kusanagi
1f2fa5c90c 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
2018-11-28 07:53:41 +01:00
Akihiko Kusanagi
241499d27f Make getHoverColor() return the original value if it is CanvasGradient (#5865) 2018-11-27 19:54:03 -05:00
Jukka Kurkela
f5437fe548 Fix nearest interaction mode to return all items (#5857)
Return all items that are at the nearest distance to the point and add unit tests for nearest + axis: 'x' and nearest + axis: 'y'
2018-11-27 16:26:41 +01:00
Stef Louwers
08447e9e19 Draw radial scale angle lines before tick labels (#5855)
Moved drawing of radial lines before drawing the tick labels, such that the radial lines are not drawn on top of the tick labels and their backdrop.
2018-11-27 15:14:41 +01:00
Akihiko Kusanagi
0351a88a63 Add support for gridLines/angleLines borderDash for polarArea/radar charts (#5850) 2018-11-26 08:57:31 +01:00
chtheis
b68341d9b8 Correct calculation of padding in percent (#5846) 2018-11-21 09:35:49 +01:00
Akihiko Kusanagi
bc494e0a81 Use empty labels for tests so as not to be affected by the font width (#5842) 2018-11-21 08:58:39 +01:00
Evert Timberg
f6d9a39cb8 Fix axis line width when option is an array (#5751)
When the axis lineWidth setting is set to an array, use the first item when determining the size of the axis area.
2018-11-18 09:45:41 +01:00
Kakhaber
ab06831f69 Is node shadow root check improved (#5828) 2018-11-18 09:36:21 +01:00
Simon Brunel
75aa44eef6
Upgrade dev dependencies to reduce vulnerabilities (#5840) 2018-11-18 09:33:34 +01:00
Thomas David Baker
ecf64d361d Correct spelling mistake. (#5831)
Use a simpler phrase for this heading.
2018-11-15 09:41:02 -05:00
Jan Tagscherer
3ea93a09f2 Add regression test for legend layout issue (#5776) 2018-11-14 11:12:57 +01:00
Jan Tagscherer
56b30e1db1 Check pixel values using the pixel proximity matcher (#5833) 2018-11-14 11:08:40 +01:00
Simon Brunel
ae80e14c51
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.
2018-11-12 21:15:37 +01:00
Akihiko Kusanagi
637c2176ec Support decimal stepSize (#5786) 2018-11-12 21:12:09 +01:00
Jan Tagscherer
7e62913cfc Change .editorconfig to include final newlines (#5827) 2018-11-12 21:06:59 +01:00
Akihiko Kusanagi
e730f87e15 Fix legend item layout issue (#5816) 2018-11-12 08:57:16 +01:00
Akihiko Kusanagi
9140ef7e67 Add a link to chartjs-plugin-colorschemes to extensions.md (#5813) 2018-11-05 18:56:29 +01:00
Bart Deslagmulder
f40abe9244 Consistent use of punctuation and quick review in docs (#5796) 2018-11-02 08:46:06 +01:00
Akihiko Kusanagi
f74699a591 Fix offsetGridLine behavior with a single data point (#5609) 2018-11-02 08:44:10 +01:00
Jordan Ephron
6bea6aba7b Document padding option for ticks configuration (#5795) 2018-11-01 16:28:11 +01:00
Hendrik Röhm
820d28907b 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.
2018-11-01 16:26:20 +01:00
Akihiko Kusanagi
cb14217c88 Add error margin for detecting if a point or line is in the chartArea (#5790) 2018-10-27 17:55:10 +02:00
Evert Timberg
b3b5c7de4f Ensure that when we check typeof x == 'number' we also check instanceof Number (#5752) 2018-10-22 09:52:05 +02:00
Ben McCann
81b4b87666 Radar code cleanup (#5624) 2018-10-21 21:56:57 +02:00
Simon Brunel
2dbf1cd1af
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).
2018-10-20 11:38:48 +02:00
Alexandre Dubé
5816770e45 Introduce the 'minBarLength' bar option (#5741) 2018-10-18 22:28:56 +02:00
Evert Timberg
f815dd5196 Ensure that when the time axis accesses data.labels it actually exists (#5750) 2018-10-18 21:28:49 +02:00
Niladri Dutta
dfbb57468f Add 'parser' instead of deprecated 'format' in samples (#5769) 2018-10-16 23:12:51 +02:00
Simon Brunel
d7eab1b994 Bump version to 2.7.3 2018-10-15 18:48:00 +02:00
Daniel Correa
1ba06a26fd Add aspectRatio property to responsive doc (#5756) 2018-10-09 18:20:09 +02:00
Miguel Martínez Serrano
9293c30d4f Add scatter link in charts documentation (#5736) 2018-09-21 21:22:31 +02:00
Maxim Atanasov
2f9c663d01 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.
2018-09-21 21:21:34 +02:00
Carl Osterwisch
7a65546629 Fix scale when data is all small numbers (#5723)
* Add test for correct handling of small numbers

* Calculate tick precision for arbitrarily small numbers

* Use scientific notation for very small tick numbers

* Calculate significant digits for exponential tick values
2018-09-16 11:33:48 +02:00
Wei-Wei Wu
bbd589d5ab Add "Accessibility" documentation page (#5719) 2018-09-11 09:12:28 +02:00
Wei-Wei Wu
1aa54b074b Add gulp watch task for docs (#5724)
gulp docs --watch
2018-09-09 20:42:18 +02:00
Colin
3830216420 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.
2018-08-10 09:32:35 +02:00
Tom Pullen
ab41173d9b 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.
2018-08-08 18:52:56 +02:00
Tom Pullen
a9c4e377a7 Add color to financial time series sample (#5661) 2018-08-08 18:44:53 +02:00
Simon Brunel
3010173733 Disable hardware acceleration for unit tests
Explicitly disable hardware acceleration to make image diff more stable when ran on Travis and dev machine.
2018-07-29 22:43:23 +02:00
Simon Brunel
91608398b6 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.
2018-07-29 22:43:23 +02:00
Sebastiaan Lokhorst
9a295816b3 Replace ES6 by Webpack in the integration docs (#5555) 2018-07-29 22:16:10 +02:00
Colin
352268616b Fix min and max option checks in linear scales (#5209)
When 0, the min and max options was considered not being set, instead we should check for null or undefined.
2018-07-29 18:09:16 +02:00
Akihiko Kusanagi
493eaa8424 Refactor helpers.canvas.drawPoint() (#5623)
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.
2018-07-29 11:31:28 +02:00
Jung Oh
0963c8f76c Fix positioning in the custom tooltip example (#5454) 2018-07-14 10:06:02 +02:00