Commit Graph

2354 Commits

Author SHA1 Message Date
Evert Timberg
4d2772e313 Fix bubble chart tooltip callback to use correct labels (#3421)
Fix bubble chart tooltip callback to use correct label parsed from scales. Fixes #3029
2016-10-06 08:54:50 -04:00
Mickael Jeanroy
b64cab0046 Refactor tooltip draw function to extract drawBackground method
See issue #3416.
2016-10-04 14:10:56 -04:00
Aidan Fewster
365bdbb346 If tick options have min, max and stepSize use them to generate evenly spaced ticks 2016-10-04 09:30:28 -04:00
Aidan Fewster
99b8d6740a Added the watchify NPM dependency to satisfy karma-browserify's peerDependency 2016-10-04 09:27:43 -04:00
Evert Timberg
c15fa98978 Display tooltip color boxes for all tooltips. Added a new displayColors option to turn them off 2016-10-04 09:20:20 -04:00
Evert Timberg
03735563f4 Improve Tooltip and Hover Interaction (#3400)
Refactored interaction modes to use lookup functions in Chart.Interaction.modes and added new modes for 'point', 'index', 'nearest', 'x', and 'y'
2016-10-03 16:05:21 -04:00
Simon Brunel
1484520692 Better animation when adding or removing data
In order to simulate real-time chart updates (i.e. horizontal animation), it's necessary to distinguish a removed or added value from a simple update. The dataset controller now hooks array methods that alter the data array length to synchronize metadata accordingly. Also remove the duplicate calls of updateBezierControlPoints() for line and radar charts.
2016-10-03 16:01:38 -04:00
Simon Brunel
9deebf8371 Fix config initialization and add unit tests 2016-09-29 17:55:04 -04:00
Simon Brunel
806a3832ef Inject iframe for responsive charts only
Responsiveness is currently based on the use of an iframe, however this method causes performance issues and could be troublesome when used with ad blockers. So make sure that the user is still able to create a chart without iframe when responsive is false.
2016-09-28 15:43:15 -04:00
Evert Timberg
d3d9573af5 Fixes HTML legend string for polar area charts to match doughnut charts. (#3361)
Fixes HTML legend string for polar area charts to match doughnut charts
2016-09-25 08:30:39 -04:00
Evert Timberg
d09a17a2b1 Better number -> string callback for the radial linear scale (#3281)
Also create a new Chart.Ticks namespace to host common tick generators and formatters.
2016-09-24 22:56:16 +02:00
Simon Brunel
d407da4e36 Merge pull request #3325 from chartjs/fix/3269
Improve multiline labeling for tooltips in doughnut charts
2016-09-24 22:31:29 +02:00
Evert Timberg
9041b5a2b9 Update default config tests and re-enable 2016-09-24 22:25:05 +02:00
Evert Timberg
c3d7a3328d In the doughnut chart, specifically handle multiline strings. 2016-09-24 22:25:04 +02:00
Evert Timberg
62ef40ebf6 skip non finite data points when determining scale sizes. Fixes #3125 2016-09-24 12:19:49 -04:00
Evert Timberg
ba133876c2 Merge pull request #3356 from simonbrunel/aspect-ratio
Fix aspect ratio and add responsive unit tests
2016-09-24 12:06:45 -04:00
Evert Timberg
f6ac8279cc Fix 2 minor documentation issues in the scale documentation. #3341 (#3360) 2016-09-24 17:54:51 +02:00
Evert Timberg
11e8c50f72 Compute correct tooltip size when there is no title present (#3324) 2016-09-24 10:58:31 +02:00
Evert Timberg
9015e72ae1 Fix the legend drawing when labels.usePointStyle is true (#3323) 2016-09-24 10:57:33 +02:00
Evert Timberg
edc22cad72 Merge pull request #3358 from dylan-kerr/fix/limit-title-length
Set maxWidth during title draw to avoid overflow
2016-09-23 20:20:01 -04:00
Evert Timberg
d57526c453 Merge pull request #3357 from kant/patch-1
Minor fixes (proposal)
2016-09-23 20:19:08 -04:00
Simon Brunel
7d65bd3f52 Initial core.controller.js unit tests 2016-09-24 00:04:33 +02:00
dylan-kerr
4f668c3ed9 Adjust expected values in core.title.tests.js 2016-09-23 22:36:58 +01:00
dylan-kerr
fb302d5f00 Set maxWidth during title draw to avoid overflow
CanvasRenderingContext2D.fillText() accepts a fourth parameter called maxWidth that sets the maximum width of the drawn text, enforced by scaling the entire line.

This commit uses the title element's layout dimensions to set maxWidth and avoid overflow outside of the canvas.
2016-09-23 22:15:23 +01:00
Darío Hereñú
503e6f8291 Minor fixes (proposal) 2016-09-23 16:00:34 -03:00
Simon Brunel
d610987cfb Fix radar default aspect ratio and samples
Now that the aspect ratio is correctly handled, fix samples for charts with aspect ratio of 1 which was vertically too large. Also fix the default aspect ratio for radar charts which wasn't applied when creating a chart directly using new Chart(ctx, { type: 'radar' }).
2016-09-23 17:47:36 +02:00
Simon Brunel
16bcd6adc5 Fix initial aspect ratio when not responsive
When responsive is false and no canvas height explicitly set, the aspectRatio option wasn't applied because of the canvas default height. Prevent the retinaScale method to change the canvas display size since this method is called for none responsive charts, but instead make the resize() responsible of these changes. Also, as discussed some time ago, moved most of the core.js logic into core.controller.js. Clean up the destroy process and make sure that initial canvas values are properly saved and restored.
2016-09-23 17:47:35 +02:00
Simon Brunel
8ec7ce2f93 Gulp command switch to run specific test files
Add the --inputs command switch to the unittest and unittestWatch tasks, to be able to run unit tests from the specified files only (e.g. gulp unittest --inputs=test/core.element.tests.js;test/core.helpers.tests.js).
2016-09-23 17:47:33 +02:00
Simon Brunel
84da2e0a10 Make charts vertically responsive (#3105) (#3326)
Ensure that the hidden iframe is stretched vertically in order to detect height changes. Remove the classlist check/call since it was incorrectly spelled (should be classList), but also useless since the iframe has just been generated. Also remove the callback check: addResizeListener should never be called w/o a valid callback.
2016-09-23 17:46:17 +02:00
Zach Panzarino
88c69f5f8c Move reverse option for labels to correct section in docs
Addresses comment in #3102
2016-09-23 00:12:40 +00:00
Simon Brunel
eea51e8678 Bump version to 2.3.0 2016-09-22 20:53:26 +02:00
Nick Downie
631b54522c Ensure the second pie chart sits inline 2016-09-21 11:17:17 +01:00
Simon Brunel
4da47a8430 Bump version to 2.3.0-rc.1 2016-09-17 11:42:28 +02:00
Simon Brunel
d9f6e6d0c5 Change bower package name for chart.js (#1562)
Thanks to the Bower team, we have been able to register the chart.js package name, previously pointing on a dead repository, which make the Bower integration more consistent with the npm one. All other alias still work (Chart.js, chartjs, Chart-js, chartjs-Chart.js).
2016-09-17 11:40:26 +02:00
Zach Panzarino
56845d3cbb Merge pull request #3315 from zachpanz88/fix-pie-multi-dataset
Fix error where pie/doughnut charts did not render correctly with multiple datasets
2016-09-15 23:19:47 -04:00
Zach Panzarino
051f5b015b Fix bug with pie/doughnut chart legends
Fixes a rendering issue when there are multiple datasets on a pie chart and they do not all contain the same number of data in their datasets
Fixes #3309
2016-09-16 01:29:01 +00:00
Evert Timberg
b5544d1a1b Merge pull request #3287 from simonbrunel/tests-cleanup
Tests cleanup
2016-09-15 18:12:34 -04:00
Simon Brunel
5c5b1bfe59 Turn off linebreak-style linting rule
On Windows, this rule conflicts when running ESLint locally on a repository setup with autoCrlf (then all lines are errors).
2016-09-15 23:10:03 +02:00
Simon Brunel
8e37a11e39 Merge pull request #3308 from zachpanz88/eslint
ESLint Updates
2016-09-15 18:01:19 +02:00
Zach Panzarino
8207027743 Implement eslint changes proposed by @simonbrunel in code review 2016-09-15 12:49:11 +00:00
Zach Panzarino
a929fd473e Include changes suggested by @etimberg in code review 2016-09-15 01:21:45 +00:00
Zach Panzarino
8bc280e185 Allow variable use before define with warning 2016-09-15 00:27:29 +00:00
Zach Panzarino
bddd4cd94b Fix style issues in core and scales 2016-09-15 00:23:30 +00:00
Zach Panzarino
dd8fa78b45 Fix more style errors in controllers, elements, and scales 2016-09-14 22:34:41 +00:00
Zach Panzarino
9bf2e2bf7a Remove func-call-spacing rule 2016-09-14 18:16:21 +00:00
Zach Panzarino
11739234a4 Add keyword spacing to eslint and update code 2016-09-14 18:12:23 +00:00
Zach Panzarino
2d2f475a7a First round of eslint fixes 2016-09-14 18:05:19 +00:00
Zach Panzarino
f6eb675470 Update new eslint rules 2016-09-14 18:03:55 +00:00
Zach Panzarino
894b9928e7 Fix broken links in Maintaining.md 2016-09-12 23:21:40 -04:00
Evert Timberg
d8b13ca4ab Merge pull request #3261 from desowin/3211
Implement moment diff cache in time scale
2016-09-12 19:37:50 -04:00