Commit Graph

324 Commits

Author SHA1 Message Date
Evert Timberg
e090691ef7 Better use of default scale types. 2016-03-19 08:50:50 -04:00
Evert Timberg
04f1e57459 Fix zoom reset 2016-03-15 20:03:28 -04:00
Evert Timberg
f64324e2a8 Merge pull request #2129 from nnnick/fix/2037
Fix animation bug.
2016-03-13 12:29:48 -04:00
Evert Timberg
4fec7dfdbb Fix animation bug. Helpers.findNextWhere no longer returned the index of the item. This causes the wrong animation object to be removed. 2016-03-13 12:24:33 -04:00
100000001
136efeaf4d Moved _model xAlign and yAlign setting to Positioning section and
swapped y and x
2016-03-10 09:05:59 +01:00
100000001
5d2444a5ee Expose yAlign and xAlign as a tooltip option 2016-03-10 09:00:26 +01:00
Evert Timberg
c3f765857e Fix some time rounding problems 2016-03-05 22:58:34 -05:00
Evert Timberg
185ea3939d Take padding into account when determining the model coordinates from event coordinates 2016-02-28 15:32:15 -05:00
Evert Timberg
8d5b3809f6 Fix global font settings 2016-02-28 13:41:17 -05:00
Evert Timberg
431f930c15 Merge pull request #2067 from nnnick/fix/animations
Fix bar chart and doughnut chart animations
2016-02-27 12:38:43 -05:00
Evert Timberg
04e6926961 Fix bar chart and doughnut chart animations 2016-02-27 12:32:20 -05:00
Mathias Küsel
96315dd3c9 Much faster cache clean up 2016-02-27 17:19:33 +01:00
Ville Hämäläinen
0f6e329aaa fix alpha for tooltip colors 2016-02-25 20:17:40 +02:00
Tanner Linsley
50d0c98030 Tooltips now respect stacked ordering
Tooltips detect the stacked scale property now, reversing when
appropriate
2016-02-17 12:42:29 -07:00
Tanner Linsley
ee81d4a804 Reversible Legends
Legends can now be reversed with the `reversed: true` property.
2016-02-17 12:42:09 -07:00
Tanner Linsley
ac5be9bde2 Proper line and bar stacking order
Stacked line and bar charts now behave predictably with the first
dataset on the bottom stacked upwards.
2016-02-17 12:41:32 -07:00
Evert Timberg
4c35bba639 When the last label would overlap with the previously shown label, skip the previously shown one 2016-02-15 10:43:19 -05:00
Evert Timberg
37b3fb5d6c Legend tests + fix minor bug where padding was not taken into account when going down to the next line 2016-02-15 09:23:31 -05:00
Evert Timberg
e589734cbb Title block tests 2016-02-14 18:04:12 -05:00
etimberg
01b88f19df Clean up code climate style issues and formatting. 2016-02-14 17:06:00 -05:00
etimberg
f6951816a0 Improve joshing reporting. Added a JSHint config file.
Fixed JSHint warnings.
2016-02-13 20:12:26 -05:00
Tanner Linsley
eb01a0d6f8 Core helpers reference 2016-02-11 23:45:14 -07:00
Tanner Linsley
813d18bd78 Passing All Tests, Updated Dependencies 2016-02-11 23:16:43 -07:00
Tanner Linsley
007d029837 Bundled builds
Possible usages are:

src/Chart.js (umd)
dist/Chart.js (ChartJS)
dist/Chart.min.js (ChartJS minified)
dist/Chart.bundle.js (ChartJS with Moment.js)
dist/Chart.bundle.min.js (ChartJS with Moment.js minified)
2016-02-11 21:29:26 -07:00
Tanner Linsley
f2780bb825 Browserify for easier UMD consumptions and vanilla builds 2016-02-11 20:30:53 -07:00
Robert Becker
e9c18f603d Merged remote-tracking branch 'upstream/v2.0-dev' into v2.0-dev to fix conflicts.
Refactored linear scale fixed step size implementation.
Added nbproject to .gitignore
2016-02-09 12:56:16 +01:00
Evert Timberg
61ca178e2b Write an almost equals function and use it in the linear scale. Added a test for this new function. 2016-02-06 09:38:44 -05:00
Robert Becker
1692b977cd Fixed tab sizing in core.helpers.js 2016-02-05 09:43:20 +01:00
Robert Becker
9a20381af4 Fixed typo in core.helpers.js.
Added ticks.fixedStepSize configuration parameter to force linear scale steps.
2016-02-04 15:20:17 +01:00
Robert Becker
ba6afa7257 Fixed label callbacks adding only a single line instead of multiple lines as stated in docs. 2016-02-04 10:35:53 +01:00
Evert Timberg
dfaf786e1a Always show lines by default. 2016-02-02 20:14:59 -05:00
Evert Timberg
d16f4fc5ce Add default font options 2016-02-01 21:06:54 -05:00
Evert Timberg
0ed39c9fd7 Fix error in math helpers. 2016-01-24 09:21:10 -05:00
Evert Timberg
c312835eb1 Add some tests for scales. Cleaned up some minor bugs in the time scale. Wrote better helpers for helpers.min and helpers.max 2016-01-23 12:44:55 -05:00
Evert Timberg
59e3ccb42a buildOrUpdateControllers now returns an array of all the new controllers that were created. Build controllers before updating the scales but only reset them afterwards because the scales need to update label moments first. 2016-01-21 22:00:21 -05:00
Evert Timberg
2d4e2f9889 Properly begin path before drawing line at edge of scale 2016-01-18 21:35:35 -05:00
Mathias Küsel
33303d8d8a Fixes resize() function 2016-01-18 17:46:11 +01:00
Mathias Küsel
c42cb148da Transition optimizations 2016-01-15 13:06:03 +01:00
Mathias Küsel
4f6e86640f Adds a caching system to expensive measureText() function 2016-01-15 13:05:03 +01:00
Mathias Küsel
25d6c2f064 Removes unused context bindings 2016-01-14 18:17:14 +01:00
Evert Timberg
7735371f45 Merge pull request #1893 from mathiask88/updateOptimizations
Add some optimizations to often used functions
2016-01-12 08:22:36 -05:00
Mathias Küsel
977d45a3e0 Add some optimizations to often used functions 2016-01-12 09:47:55 +01:00
Davis Kim
88fc6ecc5c Fix orf/olf being undefined 2016-01-11 18:54:45 -08:00
Evert Timberg
8c68f78ec3 Don't try to use undefined Scale constructors 2016-01-09 11:55:44 -05:00
Evert Timberg
8cfa60c04d Merge pull request #1854 from nnnick/fix/1853
Do not force resize if the size has not changed
2016-01-08 13:16:06 -05:00
Morley Zhi
203bbcec6c Fix a bug where ticks get culled when they don't need to be 2016-01-07 15:57:53 -05:00
Morley Zhi
fe57c8728e Re-enable this; turns out I was mislead by the label spacing 2016-01-07 12:41:42 -05:00
Morley Zhi
ebf695734c Looks like maxTicksLimit already limits gridlines, so restore this 2016-01-07 12:37:13 -05:00
Morley Zhi
f00517643e Always show the last tick 2016-01-07 12:28:09 -05:00
Morley Zhi
84a6eb4a3b Updates
(1) Only limit gridlines when maxTicksLimit is defined, so we don't blow up the tests.
(2) Add a note about running tests in CONTRIBUTING.md
(3) Rebuild files
2016-01-07 11:40:26 -05:00
Morley Zhi
6478f93ded Use ticks.maxTicksLimit to limit gridlines (fixes #1859); use getValueOrDefault for resolving the maxTicksLimit option 2016-01-07 10:44:56 -05:00
Evert Timberg
310eada01a Do not force resize if the size has not changed 2016-01-05 20:16:18 -05:00
Evert Timberg
579e322809 Merge pull request #1840 from nnnick/fix/1731-part-2
Better handling of large tooltips
2016-01-02 20:16:37 -05:00
etimberg
a9a003c4c4 clean up helpers file before starting work 2015-12-31 18:41:21 -05:00
Evert Timberg
d9cc1219ce Better handling of large tooltips 2015-12-29 12:58:53 -05:00
Evert Timberg
824f5880fb Merge pull request #1837 from nnnick/fix/1766
Better fitting of scales
2015-12-29 10:16:46 -05:00
Evert Timberg
d6a27d8eb3 Clean up code 2015-12-29 09:56:55 -05:00
Evert Timberg
0c534e1eb8 Fix layout service 2015-12-29 09:07:01 -05:00
Evert Timberg
754268890b Alias the pixel for nicer drawing 2015-12-28 09:37:31 -05:00
Evert Timberg
f2899934db Draw line at edge of scales & update tests 2015-12-28 09:26:59 -05:00
Tanner Linsley
31721a353c Merge pull request #1829 from nnnick/fix/1716-1731
Better tooltip positioning
2015-12-23 10:22:34 -07:00
Tore Lervik
ad67d1ecf8 Fixed bug with skipRatio check not being triggered correctly. 2015-12-23 13:42:24 +01:00
Evert Timberg
f170fd1b8d Improvements to tooltip alignment to avoid the canvas edges 2015-12-22 21:35:23 -05:00
Evert Timberg
a423542775 Fix tests 2015-12-22 09:13:02 -05:00
Tore Lervik
d134394a1d Refactored out property 2015-12-21 23:37:09 +01:00
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