Commit Graph

259 Commits

Author SHA1 Message Date
Tore Lervik
cd02434943 Refactored skipRatio to use the longest label text for calculation. 2015-12-21 23:32:52 +01:00
Evert Timberg
d7643bf865 Initial refactor of tooltip code 2015-12-21 15:52:33 -05:00
Evert Timberg
63b14dc2a9 Merge pull request #1810 from olyckne/fix/ticks_callback
Fix ticks callback and auto skip
2015-12-21 08:23:55 -05:00
Mattias Lyckne
7363c6fcbe Dont set autoSkip false if userCallback is defined
”The reason being is that the user could replace either callback or
userCallbac”
2015-12-21 13:59:29 +01:00
Evert Timberg
bafd36b5ec Fix sizing of tooltip when beforeBody or afterBody is very line 2015-12-20 18:48:44 -05:00
Evert Timberg
5f4e8a4c13 Merge pull request #1794 from nnnick/update-scale-lifecycle
Update Scale Lifcycle
2015-12-19 14:29:49 -05:00
Mattias Lyckne
23b2d991f7 disable autoSkip when there is a userCallback or autoSkip is set to false 2015-12-18 16:18:49 +01:00
Kriss
d9363d637a maxRotation test is off by one
Most notable when maxRotation=0 and you end up with the text becoming non centred as it has rotated it by 1 and switched to right alligned mode.
2015-12-17 22:00:12 +00:00
Evert Timberg
c8d3831152 Split out data limits step of scales into it's own step. Wire up callbacks from the options to those in the scale life-cycle. Updated the docs accordingly 2015-12-17 09:21:04 -05:00
Evert Timberg
139cbe1c64 All dataset controllers now inherit from a common base class Chart.DatasetController. This makes writing external controllers much easier 2015-12-13 14:35:40 -05:00
Evert Timberg
716e303230 Call animation callbacks. Created a sample file that shows their use by updating a progress bar during the animation. Updated the documentation to show how they are called. 2015-12-12 10:01:08 -05:00
Evert Timberg
95332e39f5 Merge branch 'v2.0-dev' into fix/1725
Conflicts:
	src/core/core.controller.js
2015-12-12 09:01:59 -05:00
Evert Timberg
39e5daaca8 Better property picking. Added a helper function so we don't have to write a complicated ternary everywhere. Updated tests accordingly. 2015-12-12 08:52:06 -05:00
Derek Perkins
4add69432f Merge pull request #1750 from nnnick/v2.0-legend
Legend and Title Support
2015-12-11 18:52:26 -07:00
Evert Timberg
7999aab26a Fix up issues in core scale 2015-12-08 20:22:02 -05:00
Evert Timberg
d689e0fc47 When only the dataset array changes scales did not update correctly. This was due to the fact that the new datasets did not have scale IDs yet. By building the controllers first, the IDs are mapped if necessary. Then we can correctly update scales. 2015-12-08 19:57:58 -05:00
Evert Timberg
819f865723 Merge branch 'v2.0-dev' into v2.0-legend
Conflicts:
	src/controllers/controller.doughnut.js
2015-12-07 22:10:38 -05:00
Evert Timberg
4f8f182d21 Better sizing when not displaying 2015-12-07 21:58:48 -05:00
Evert Timberg
a2e1a97382 Update docs + remove unused config option since we don't need 2 different callbacks. 2015-12-07 21:52:15 -05:00
Evert Timberg
8befbbe8f0 Use config onClick function to toggle datasets for bars/lines/radar charts. 2015-12-07 20:36:44 -05:00
Evert Timberg
b0f69a1092 Generate nice legend boxes for all current chart types 2015-12-07 19:11:54 -05:00
Evert Timberg
ffa2870b56 Fix a few more issues in the tooltips 2015-12-07 18:23:51 -05:00
Evert Timberg
1cb7dde0d5 Start fixing code climate issues 2015-12-07 18:19:56 -05:00
Evert Timberg
20b9395585 Merge pull request #1745 from nnnick/fix/1710
Remove unused tooltip options
2015-12-07 17:46:49 -05:00
Evert Timberg
bffbaf6b37 Generate label strings using an option function. This allows new chart types to override 2015-12-06 12:53:45 -05:00
Evert Timberg
eba2fce923 Docs + move defaults to correct place. 2015-12-06 11:19:55 -05:00
Evert Timberg
792ee587ae Split legend and title block functionality into 2 separate blocks. This allows the title to be on the top of the chart while the legend is on the bottom 2015-12-06 10:20:38 -05:00
Evert Timberg
7ab2a5ed9a Remove unused xOffset property from the tooltip. Use the multiKeyBackground. Update documentation accordingly. 2015-12-06 09:38:19 -05:00
Evert Timberg
28fc6841f3 Add tooltipFormat option to time scale options.
Fix bars when displayed on a time scale.
Updated sample files.
2015-12-05 19:33:33 -05:00
Evert Timberg
0c247dde28 Gracefully handle setting options.animation to false which occurs when migrating configs from v1. 2015-12-05 10:40:05 -05:00
Evert Timberg
784fa78267 Merge pull request #1738 from nnnick/fix/1735
Call `beforeBody` and `afterBody` using the correct function.
2015-12-05 10:01:15 -05:00
Evert Timberg
744e1429b9 Label polar area and doughnut datasets 2015-12-04 20:32:18 -05:00
Evert Timberg
59fb1696a8 Highlight correct items when hover mode is set to 'dataset' 2015-12-04 20:01:04 -05:00
Evert Timberg
0b260d57cc Fix JSHint issue 2015-12-03 21:25:36 -05:00
Evert Timberg
dcc06eb3bb Merge branch 'v2.0-dev' into v2.0-legend
Conflicts:
	src/core/core.scaleService.js
2015-12-03 21:21:10 -05:00
Evert Timberg
0a92cf1b40 Call beforeBody and afterBody using the correct function. 2015-12-03 18:46:21 -05:00
Tanner Linsley
62bc4e42ec Merge pull request #1736 from nnnick/umd-build
Umd build
2015-12-02 20:37:04 -07:00
etimberg
95a172df06 Remove old and stuff. Use the correct color variable instead of window.color 2015-12-02 22:15:03 -05:00
Evert Timberg
14c2cf56d1 Merge pull request #1728 from ashayas/bugfix/1722
Realized minRotation not needed, removed as an option and removed from tests
2015-12-02 07:30:55 -05:00
npsecoding
164671ffeb Realized minRotaion not needed, removed as an option and removed from tests 2015-12-01 22:29:19 -08:00
etimberg
bf277473c6 Update scale fitting to prevent horizontal scales from jumping around. 2015-12-01 21:01:13 -05:00
Evert Timberg
e91e6be851 Merge pull request #1696 from nnnick/fix/1688
When tooltip opacity is less than 1e-3, round to 0.
2015-11-29 10:16:25 -05:00
Evert Timberg
349586e14c Merge pull request #1695 from nnnick/fix/consistent-display-parameters
Fix inconsistent display parameters
2015-11-29 10:16:20 -05:00
wuchangming
7aa2fd1af3 Bug in handler event.type='touchend'
In Chorme.
while event.type = "touchend” ,  event.touches is a empty TouchList,
event.touches.length === 0
2015-11-27 11:16:54 +08:00
Evert Timberg
55670b0cf7 When opacity is less than 1e-3, round to 0. IE11/Edge had problems with very small opacities on the order of 1e-10. 2015-11-25 19:31:26 -05:00
Evert Timberg
a90aac7b26 Change scale show properties to display and update tests 2015-11-24 19:18:15 -05:00
Cedric van Putten
ae51789c32 Stored pixel ratio in a variable with a fallback value for browsers that doesn't support window.devicePixelRatio fixing rendering issues for IE10 and IE9. (issue #1622) 2015-11-24 11:26:24 +01:00
etimberg
37abe74d43 Improve drawing when title is placed below legend boxes 2015-11-23 22:12:34 -05:00
etimberg
ea15aaaec2 Fix draw issue 2015-11-23 21:54:45 -05:00
Evert Timberg
10d056a4d1 Adds strikethrough of legend text when dataset is hidden 2015-11-23 21:04:41 -05:00
Evert Timberg
0d1f63e601 Update after legend toggle since scales may need to change 2015-11-23 19:03:24 -05:00
Evert Timberg
afc6d9094b Allow clicking on legend text 2015-11-23 18:58:51 -05:00
Evert Timberg
60c1609ba9 Initial toggling of datasets from the legend.
Still need to do:
- clicking on text in legend
- toggling style of legend based on dataset style
- figure out if we need an
2015-11-22 22:31:08 -05:00
etimberg
0a17edd1ae Minor improvement to code that gets active elements 2015-11-21 22:44:11 -05:00
etimberg
2efb974189 ensure that fullwidth boxes are at very top / bottom 2015-11-21 22:10:39 -05:00
Evert Timberg
7b719e6432 Modify layout service to be able to place horizontal boxes as either full width or not full width. Currently the legend is the only full width box we have. Scales were modified so as not to be full width, however Core.Scale can handle boxes that are full width.
Updated unit tests to use correct 'boxes' property of chart instance. Tests did not require numerical updates!

Added a test to cover placing a full width box.
2015-11-21 10:51:32 -05:00
Evert Timberg
2a9b3e5221 Merge branch 'v2.0-dev' into v2.0-legend
Conflicts:
	src/core/core.controller.js
2015-11-21 09:23:33 -05:00
Tanner Linsley
5a80b9e501 Merge pull request #1645 from nnnick/fix/null-callback
Hide lines for which the tick label callback returns null or undefined
2015-11-16 16:10:16 -07:00
Tanner Linsley
ae9db841f9 Merge pull request #1646 from nnnick/fix/1640
Can now replace entire chart data object on the fly
2015-11-16 16:10:01 -07:00
Tanner Linsley
937d866bd3 Merge pull request #1647 from nnnick/fix/1324
Fall back to line settings for points if necessary
2015-11-16 16:09:53 -07:00
Tanner Linsley
592414330b Merge pull request #1644 from nnnick/fix/touch-events
Do not bind to touchend events for tooltips
2015-11-16 16:09:41 -07:00
Evert Timberg
d61745a311 Handle transitioning NaNs 2015-11-14 22:49:53 -05:00
Evert Timberg
55c7d6872a Prevent NaN results when previous, point, and next are all the same 2015-11-14 22:49:08 -05:00
Evert Timberg
7f34d8dd2f Always include padding to ensure that we can always see the tick labels of vertical axes 2015-11-13 13:24:22 -05:00
Evert Timberg
66bc1dc492 Reference data from the main controller wherever possible. Updated tests to account for this. 2015-11-13 09:38:35 -05:00
Evert Timberg
8e3ba9d88e Update tooltip colour draw code 2015-11-13 08:20:39 -05:00
Evert Timberg
14b6fdd51e Bail out, same as the x axis 2015-11-11 21:40:29 -05:00
Evert Timberg
3099d967da Do not bind to touchend events. This is the same as v1.x 2015-11-11 21:21:25 -05:00
Pascoual
234efc5267 Fix: tooltips checks indent 2015-11-10 01:00:30 +01:00
Pascoual
c4d02a8f96 Fix: no tooltips when missing data for one or more dataset 2015-11-10 00:53:08 +01:00
Tanner Linsley
b0380d4ede Check if dataset is visible when adding active elements to a tooltip 2015-11-01 22:50:16 -07:00
Tanner Linsley
28bc80e439 ElementsAtLabel now returns all datasets' elements at the found index 2015-11-01 22:44:31 -07:00
Tanner Linsley
d46524aedc Tooltip's label mode now uses average position of all points 2015-11-01 22:43:44 -07:00
Tanner Linsley
f4a5a30451 Only call custom tooltips when elements have changed. But be sure to call update internally any time that tooltips need to be redrawn. 2015-11-01 13:56:36 -07:00
Tanner Linsley
93a923d38f Remove logs 2015-10-31 18:17:42 -06:00
Tanner Linsley
22aabdbfab Update tooltip only when things change (which will only trigger customTooltips when model changes) 2015-10-31 18:17:32 -06:00
Tanner Linsley
5ba1ec0d3b More concise change detection 2015-10-31 18:17:06 -06:00
Tanner Linsley
8398d26d10 Remove Tooltip opacity from core-controller 2015-10-31 18:16:35 -06:00
Tanner Linsley
fa33f3158e Don't kill lastActives on chart hover exit 2015-10-31 18:15:58 -06:00
Tanner Linsley
0fa03fad24 Handle opacity in the tooltip update method 2015-10-31 18:14:56 -06:00
Tanner Linsley
ecf5801787 call the custom callback in tooltip options 2015-10-31 16:07:57 -06:00
Tanner Linsley
753fd79bf3 Call tooltip update even when tooltip has no active elements 2015-10-31 16:07:36 -06:00
etimberg
c316f90999 Polar area tooltip improvements 2015-10-30 21:04:45 -04:00
etimberg
1017934dce tooltips for radar charts are working 2015-10-30 20:35:36 -04:00
etimberg
6716dbb7e5 Fix up arguments to tooltip callbacks. Simplified code in some places and removed old code. 2015-10-30 20:12:05 -04:00
etimberg
9bebedd967 Play around with tooltip to see if a better API is possible. No longer crashes for polar area / doughnut / radar charts 2015-10-28 22:52:43 -04:00
Tanner Linsley
872b7b6161 Legend now centers labels and draws their box colors/styles 2015-10-27 02:34:23 -06:00
Tanner Linsley
15ff3f9edc Core Scale now plays nice with layoutService and full width 2015-10-27 02:33:19 -06:00
Tanner Linsley
9ab505caec Layout Service readability & reorganization
The layout service now treats all horizontal boxes as full width.
Scales are expected to use the margins to know where to line up with
the chartArea.
2015-10-27 02:32:55 -06:00
Tanner Linsley
a91dba3e8a 50% Canvas Legend Support 2015-10-26 13:57:59 -06:00
Tanner Linsley
559ee6291e Merge pull request #1567 from nnnick/fix/rounding
Better linear scale tick formatter + small tick generation
2015-10-24 01:40:43 -06:00
Tanner Linsley
1c40d50097 recursive and accurate getRightValue 2015-10-24 01:22:12 -06:00
etimberg
0c3d9ec5dd Improved number format function. Also improved the generation of small tick values 2015-10-23 22:00:59 -04:00
Tanner Linsley
7b13e902ff Bad values for data are now converted to NaN 2015-10-23 16:36:59 -06:00
Tanner Linsley
9d540cebb6 SplineCurve function now graciously handles skipped points 2015-10-23 16:36:33 -06:00
Tanner Linsley
3a20d1187e Merge pull request #1542 from nnnick/v2.0-dev-tooltip-refactor
V2.0 dev tooltip refactor
2015-10-23 13:02:57 -06:00
Tanner Linsley
60f2426774 Only use active datasets in the tooltip body 2015-10-23 12:41:21 -06:00
Tanner Linsley
bc41909e7a Track lastTooltipActive for change animations
Since we split up the hover and tooltips modes, both changes need to be
tracked for visual updates between the two.
2015-10-23 12:41:21 -06:00
Ryan Mitchell
57979a2270 Fix similar typos in core.controller & element 2015-10-22 12:47:45 -04:00
Ryan Mitchell
ef1c4fb0cb Fix typo in core.helpers.js 2015-10-22 12:41:03 -04:00