Commit Graph

1102 Commits

Author SHA1 Message Date
Evert Timberg
f106e1bf2d fix tooltip with array returns 2016-06-14 19:19:15 -04:00
Evert Timberg
f3d4ee9333 Capping these to the chart bounds causes lines to bend during pan and zoom 2016-06-12 09:19:33 -04:00
Simon Brunel
53eb7667dd New datasets update plugin extensions
Add `beforeDatasetsUpdate` and `afterDatasetsUpdate` plugin notifications during the chart update. Plugins are able to cancel the datasets update by explicitly returning false to `beforeDatasetsUpdate`. For consistency, rename `(before|after)DatasetDraw` to `(before|after)DatasetsDraw`.
2016-06-11 00:17:48 +02:00
Simon Brunel
dfdbd4465c Allow to register/unregister an array of plugins
The plugins service now accepts an array of plugin instances to register or unregister (for consistency, renamed `Chart.plugins.remove` to `unregister`). Also added a few methods to manipulate registered plugins, such as `count`, `getAll` and `clear` (mainly used by our unit tests).
2016-06-11 00:17:44 +02:00
Simon Brunel
a55c17d73f Enhance plugin notification system
Change the plugin notification behavior: this method now returns false as soon as a plugin *explicitly* returns false, else returns true. Also, plugins are now called in their own scope (so remove the never used `scope` parameter).
2016-06-10 22:26:55 +02:00
Simon Brunel
7a419af4c2 Rename plugin service and notification method
Rename `Chart.pluginService` to `Chart.plugins` (so move the old Chart.plugins array as a private member of the service), and rename `notifyPlugins` to `notify` for consistency with other service methods.
2016-06-10 22:26:35 +02:00
Evert Timberg
e7834442ac Merge pull request #2739 from msimulcik/master
Fix of radial linear scale font family settings bug
2016-06-09 18:36:26 -04:00
Evert Timberg
b1c50ed0c2 Merge pull request #2732 from chartjs/scale-colors-per-line
Scale colors per line
2016-06-09 18:35:48 -04:00
Evert Timberg
3aeddf5239 Merge pull request #2723 from chartjs/vertical-legend
Vertical legend
2016-06-09 18:35:29 -04:00
Jack Valuntine
7d63bf085a time type xAxis height crah in line chart
if input only one data in dataset and xAxis type is date make offset crash.
check offset value and don't devide 0 value.
Add xAxis check test case.
2016-06-09 13:34:15 +09:00
Evert Timberg
8d94e3e427 Merge pull request #2712 from simonbrunel/helpers-cleanup
Rewrite a few helpers to be more efficient
2016-06-08 20:08:44 -04:00
Jack Valentine
29bc3b0b8b ChartJS tooltip fontColor fix
fixed global variable name fix
callback variable name fix
- 'titleColor' to 'titleFontColor'
- 'bodyColor' to 'bodyFontColor'
- 'footerColor' to 'footerFontColor'
2016-06-09 00:04:20 +09:00
Miroslav Simulcik
6e3c6c05ad Fixed radial linear scale font family settings bug 2016-06-08 15:21:54 +02:00
Evert Timberg
fbecfa2baf Reduce duplicated code in core scale draw method 2016-06-07 22:03:36 -04:00
문승찬
7ebf85eacf change tooltip font color option
bodyColor  -> bodyFontColor
titleColor -> titleFontColor
footerColor -> footerFontColor
2016-06-08 10:16:38 +09:00
Evert Timberg
6b2cfd5e11 Support arrays of colors and line widths in cartesian axes 2016-06-07 20:22:06 -04:00
Evert Timberg
a687749ed4 Radial linear scale array properties for line width and color 2016-06-07 20:09:33 -04:00
Ryan M. Poe
77357e57d6 Refactor spanGaps for line graphs with sparse data (#2721)
Fix #2435, this very slim patch (including its relevant documentation addition) adds a small option to line chart datasets (spanGaps) that allows users trying to graph sparse datasets to have lines between null entries drawn, rather than omitted.
2016-06-07 09:15:26 +02:00
Evert Timberg
71cbc4c5c1 Optimize legend drawing 2016-06-06 22:14:42 -04:00
Evert Timberg
80bd7d3f60 Initial vertical legend mode 2016-06-06 21:41:40 -04:00
Evert Timberg
959b4eedf6 Merge pull request #2716 from thebenedict/master
Make canvas element display: block by default, with config option to …
2016-06-06 10:14:59 -04:00
thebenedict
0b19689b00 style canvas element display: block by default 2016-06-06 17:05:44 +03:00
Simon Brunel
287cefc9b9 Rewrite a few helpers to be more efficient
Resolve at definition time if a browser built-in method or our polyfill should be used, so avoid checking it for each call. Also, `helpers.extend` doesn't need to iterate two times on the function arguments. Finally, remove helpers never referenced.
2016-06-05 23:23:19 +02:00
Evert Timberg
76d284c4ae Merge branch 'multiline_labels' of https://github.com/Tarqwyn/Chart.js into Tarqwyn-multiline_labels
Conflicts:
	src/core/core.scale.js
2016-06-04 20:48:26 -04:00
zachpanz88
148c66fe95 Update this -> me with master 2016-06-04 14:16:35 -04:00
zachpanz88
5fae4dd305 Change this -> me in source files
This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
2016-06-04 14:14:16 -04:00
Evert Timberg
76a64930a3 Merge pull request #2696 from NoelOConnell/master
Fix for chart title not updating
2016-06-04 10:51:29 -04:00
Evert Timberg
ca07f72f6b Merge pull request #2698 from dennybiasiolli/fix_label_fillstyle
legend: fix rendering in browsers other than Chrome
2016-06-04 10:47:15 -04:00
Tarqwyn
e856dda04f Suggested changes from PR review
Changes to be committed:
	modified:   docs/02-Scales.md
	modified:   src/core/core.helpers.js
	modified:   src/core/core.scale.js
	modified:   test/core.helpers.tests.js
2016-06-03 20:15:29 +01:00
Tarqwyn
2bc8e3c7f6 This PR allows for multi-line labels, as per Slack discussion..
Usage: If a label is an `array` as opposed to a `string` i.e. `[["June","2015"], "July"]` then each element is treated as a seperate line. The appropriate calculations are made to determine the correct height and width, and rotation is still supported.

view samples/line-multiline-labels.html to see it working.

On branch multiline_labels
Changes to be committed:
	modified:   docs/03-Line-Chart.md
	new file:   samples/line-multiline-labels.html
	modified:   src/core/core.helpers.js
	modified:   src/core/core.scale.js
2016-06-03 17:12:19 +01:00
Denny Biasiolli
435b392e92 legend: fix rendering in browsers other than Chrome when dataset.backgroundColor is Array 2016-06-03 11:39:30 +02:00
Noel
54d1e49bb7 Fix for chart title not updating
https://github.com/chartjs/Chart.js/issues/2686

Chart options were using a cache value from initialize function.
Now updating values in the beforeUpdate lifecycle.
2016-06-03 09:07:14 +01:00
Evert Timberg
7ea36aead3 Add a way to know when a resize occurs. 2016-06-02 20:43:38 -04:00
Evert Timberg
829c2be2bc Merge pull request #2680 from chartjs/fix/clipping
Remove clipping and add plugin hooks.
2016-06-02 20:35:39 -04:00
Aaron Ballard
7f70afe864 Added a reference to Chart within Chart for Issue #2483 2016-06-02 16:04:33 -05:00
Evert Timberg
10f01088e4 add afterDatasetDraw in correct place 2016-06-01 07:18:27 -04:00
Evert Timberg
b96fdcaf85 Docs on new plugin callback 2016-05-31 22:28:22 -04:00
Evert Timberg
b22e32c007 Remove clipping and add plugin hooks. Zoom plugin can then do the clipping itself 2016-05-31 22:16:29 -04:00
Evert Timberg
600f5b9ba0 Improve core and polar area 2016-05-30 21:55:58 -04:00
Evert Timberg
a5167cc42d Reduce duplicated code in doughnut controller 2016-05-30 21:33:11 -04:00
Evert Timberg
fcff496301 Improve bubble controller minification and code duplication. 2016-05-30 19:07:31 -04:00
Evert Timberg
a5ab4521a1 Merge pull request #2661 from chartjs/tooltip-improvements-and-tests
Improve tooltip performance and added new options
2016-05-29 12:10:30 -04:00
Evert Timberg
3cd21c8053 Linear and RadialLinear scales now derive from a common base class 2016-05-29 10:16:47 -04:00
Evert Timberg
6bc917c8e3 Improve testing on the CI 2016-05-28 21:08:20 -04:00
Evert Timberg
b646f6d816 Add a way of sorting tooltip items with a custom sort function 2016-05-28 20:47:36 -04:00
Evert Timberg
af5344462e Improve tooltip minification 2016-05-28 19:39:15 -04:00
Evert Timberg
8d20379e29 Initial tooltip tests + fix a bug when the tooltip beforeLabel and afterLabel callbacks returned strings 2016-05-28 15:26:46 -04:00
Evert Timberg
9269411799 Merge pull request #2657 from chartjs/tooltip-color-callback
Provide a way to configure the colour of tooltip items
2016-05-28 12:14:27 -04:00
Evert Timberg
c1b8839a69 Merge pull request #2660 from chartjs/fix/2613
When destroying the chart, any animations should be stopped.
2016-05-28 11:26:09 -04:00
Evert Timberg
f247536b4a When destroying the chart, any animations should be stopped. 2016-05-28 11:05:02 -04:00
Evert Timberg
528680d666 Merge pull request #2658 from chartjs/fix/2580
Allow turning off lines on a per dataset basis
2016-05-28 10:56:25 -04:00
Evert Timberg
327b8d82f5 Allow turning off lines on a per dataset basis 2016-05-27 22:20:51 -04:00
Evert Timberg
b3f8a53ea5 Merge pull request #2640 from chartjs/legend-and-title-as-plugins
Legend and title as plugins
2016-05-27 21:19:28 -04:00
Evert Timberg
66aa65be68 Tooltip now has a callback for configuring the colors of items displayed. Added docs and improved the options passed to the tooltip 2016-05-27 21:07:02 -04:00
Evert Timberg
bcd17e5840 Merge pull request #2649 from chartjs/fix/2647
Line points always need to pivot
2016-05-26 20:23:10 -04:00
Evert Timberg
c6eb8bf58c Line points need always need to pivot after regardless of whether or not bezier points are updated. Bezier points should only be updated if the line tension is not 0. 2016-05-26 20:02:46 -04:00
Evert Timberg
cca4c76c00 Don't use translates and rotates for drawing rotated rectangles 2016-05-26 19:38:27 -04:00
Evert Timberg
46fc96bf4d Remove unused code from core controller. 2016-05-25 21:30:22 -04:00
Evert Timberg
d6289c6129 Convert title block to a plugin 2016-05-25 21:28:02 -04:00
Evert Timberg
1ae0f5e4d4 Legend is attached to the graph as a plugin. 2016-05-25 21:23:46 -04:00
Simon Brunel
08de9faf10 Fix #2418 Firefox old version compatibility
Old versions of FF doesn't accept accessing the computed style via the 'max-width' and 'max-height' CSS notations using brackets, in which case the returned value is undefined. Changed the constraint methods to use maxWidth and mawHeight instead and make sure to test valid values.
2016-05-25 22:51:41 +02:00
Simon Brunel
7f71990a40 Decomplexify Chart.core.controller.eventHandler
Refactor redundant code, use local variables and introduce a new helper to compare arrays (Chart.helpers.arrayEquals).
2016-05-22 00:58:02 +02:00
Simon Brunel
d584afb543 Refactor controller scale methods
Rewrite these two methods to reduce code duplication. Note that options.scale is not anymore mapped to 'radialScale' ID but to 'scale' ID (see ensureScalesHaveIDs), since this ID is not referenced anywhere in the code base.
2016-05-22 00:25:53 +02:00
Simon Brunel
7108f78d2f Refactor addElements and addElementAndReset
Data controllers should now rarely implement addElements and addElementAndReset but instead should define dataElementType (and optionally datasetElementType). Also remove some dead code (e.g. numBars, colorForNewElement, etc.).
2016-05-22 00:25:51 +02:00
Simon Brunel
a566d16e69 Refactor scale base pixel and point calculation. 2016-05-20 20:17:28 +02:00
Simon Brunel
8c5d8855c6 Merge pull request #2551 from chartjs/helper-perf-and-minification
Helpers improvements
2016-05-19 19:51:06 +02:00
Evert Timberg
ecb7ce133e Merge pull request #2590 from haschu/fix/2589
This fixes #2589
2016-05-19 07:02:58 -04:00
haschu
393db2a609 This fixes #2584 (#2592)
Improve scale auto-skipper when labels are not rotated
2016-05-18 18:20:06 -04:00
Evert Timberg
f24dddeda7 Merge pull request #2567 from adileo/master
Fixed tooltip not showing in NULL datapoint in multi line chart
2016-05-18 17:51:49 -04:00
Evert Timberg
d23b2395ff Merge pull request #2578 from simonbrunel/optimizations
Point element and line controller optimizations
2016-05-18 17:51:37 -04:00
Hagen Schulze
577c1406dd This fixes #2589 2016-05-18 20:42:54 +02:00
AllenJB
966d737617 Fix handling of moments by scale.getRightValue
When using {x: moment, y: value} datapoints
2016-05-18 17:38:20 +01:00
Simon Brunel
93c28a4d5f Optimize element.point and controller.line
Change some helpers.each() to `for` loops when iterating on a potentially large number of items and use more local variables when appropriate (making the minified build a bit smaller).
2016-05-18 00:25:45 +02:00
Evert Timberg
ca7434a5ea Merge pull request #2569 from chartjs/fix/2216
Improve bar sizing
2016-05-17 18:04:23 -04:00
Ceane Lamerez
456ab9ca36 Fix #2574 - Add support to hide border on the chart 2016-05-17 21:35:19 +02:00
Simon Brunel
69521477a1 Remove useless hasOwnProperty checks
The Chart.helpers.each method uses Object.keys() to iterates on the object *own enumerable properties*, meaning that checking if object.hasOwnProperty() is useless.
2016-05-17 19:49:17 +02:00
Evert Timberg
45969a3903 Horizontal bars are similar 2016-05-16 22:17:45 -04:00
Evert Timberg
6bb6e5aa4b Improve tick width for vertical bars 2016-05-16 22:14:33 -04:00
Adileo Barone
4b540e70cf Fixed tooltip not showing in NULL datapoint in multi line chart 2016-05-16 21:02:57 +02:00
Evert Timberg
48368117e9 Helpers improvements 2016-05-14 15:59:40 -04:00
Simon Brunel
b64e03dbd0 Bump chartjs-color to version 2.0.0 (#2549)
Fix color animation because the color lib changed the `mix` implementation to match SASS behavior, so the weight specifies the amount of the first color that should be included in the returned color.
2016-05-14 13:35:35 -04:00
Blake Niemyjski
a3d75d2087 More perf and minification changes based on feedback 2016-05-14 08:58:42 -05:00
Blake Niemyjski
7e85245e4f Fixed unit tests :D 2016-05-13 22:39:11 -05:00
Blake Niemyjski
53b08415ad There were conflicting tick variables 2016-05-13 22:23:34 -05:00
Blake Niemyjski
b4a269da19 Updated magnification and possible bug fix in removeHoverStyle 2016-05-13 22:16:28 -05:00
Blake Niemyjski
bea68f1424 Performance and minification improvements 2016-05-13 22:07:39 -05:00
Evert Timberg
266fa66067 Merge pull request #2543 from chartjs/fix/2519
Error when first data point on time scale had null data
2016-05-13 19:54:57 -04:00
Evert Timberg
f34453cf8f Error when first data point on time scale had null data 2016-05-13 19:50:59 -04:00
Evert Timberg
d0dd7ceabe Provide different default tooltip functions for horizontal bar 2016-05-13 19:36:32 -04:00
Evert Timberg
30967ac415 Horizontal bar defaults should skip left edge 2016-05-13 19:13:34 -04:00
Evert Timberg
14021069c3 Merge branch 'master' into file-size-reduction
Conflicts:
	src/controllers/controller.doughnut.js
	src/controllers/controller.polarArea.js
2016-05-12 18:57:22 -04:00
Evert Timberg
8c209405e9 Merge branch 'iso_weekday' of https://github.com/tomduncalf/Chart.js into tomduncalf-iso_weekday
Conflicts:
	docs/01-Scales.md
2016-05-12 18:24:14 -04:00
Evert Timberg
41c043dd23 Merge branch 'master' of https://github.com/nnnick/Chart.js
Conflicts:
	docs/01-Scales.md
2016-05-12 18:22:55 -04:00
Evert Timberg
47f770c3ef Merge pull request #2524 from ashiguruma/master
Allow canvas patterns instead of colors
2016-05-12 18:20:40 -04:00
Tom Loudon
05bfb7e964 Added CanvasPattern global flag for jshint
The core.helpers file was failing linting checks as the global CanvasPattern was not defined. Added the `/* global CanvasGradient */` statement to make linting pass. Updates chartjs/Chart.js#1323
2016-05-12 22:58:54 +01:00
Tom Duncalf
7ee5af81af Add labelOffset option to scales 2016-05-11 10:43:22 +01:00
Tom Duncalf
8b3d079a50 Add isoWeekday option to allow time scale ticks in 'week' unit mode to start on a specified day of the week 2016-05-11 09:44:02 +01:00
Tom Loudon
04d4adda05 Allow pattern hover state in all chart types
Updated all chart types to use the helper.getHoverColor. Pattern fills can now be specified for both fill and line portions of a chart. Updates chartjs/Chart.js#1323
2016-05-10 17:28:29 +01:00
Tarqwyn
84b7d07526 Following a Slack conversation tadd new Callback to allow updates to datasets config (ie borderColor) based on results of the calculated scale, A typical use case would be apply a Gradient fill.
On branch feature_New_plugin_interface_afterScaleUpdate
Changes to be committed:
	modified:   dist/Chart.bundle.js
	modified:   dist/Chart.bundle.min.js

 #On branch feature_New_plugin_interface_afterScaleUpdate
 #Changes to be committed:
2016-05-10 15:59:12 +01:00
Tom Duncalf
3bef974c25 Add minRotation support 2016-05-10 12:33:36 +01:00
Evert Timberg
ebffa52dc2 allow callback or userCallback in the time scale 2016-05-09 17:14:25 -05:00
Evert Timberg
23722a8b25 Make the afterUpdate plugin method more useful 2016-05-09 17:14:15 -05:00
Tom Loudon
170fdab6a6 Removed 'background' from hover color helper name.
Patterns could be used for style attributes other than background e.g. stroke. Updates  chartjs/Chart.js#1323
2016-05-09 07:29:52 +01:00
Evert Timberg
ee383ef4a6 Logarithmic scale improvements 2016-05-08 09:24:45 -04:00
Evert Timberg
e86a13dcef More linear scale work 2016-05-08 08:32:48 -04:00
Evert Timberg
b35b246414 Merge branch 'master' into file-size-reduction 2016-05-08 08:11:16 -04:00
Evert Timberg
4ef5d942e6 Linear scale improvements 2016-05-08 07:55:29 -04:00
Evert Timberg
33d10374bb Minor improvement to polar area controller 2016-05-07 21:37:24 -04:00
Evert Timberg
52a8654989 Ensure that when calculating tick width in the bar controller, we use the number of ticks in the scale, not the number of data points. 2016-05-07 21:28:13 -04:00
Evert Timberg
166801055e Improvements to polar area controller. Moved common draw code up to core dataset controller 2016-05-07 21:04:39 -04:00
Evert Timberg
9d832cc39d More donut improvements 2016-05-07 19:47:40 -04:00
Tom Loudon
5866f73562 Added helper to allow a CanvasPattern for hover. Updates chartjs/Chart.js#1323
When a hover background isn't specified in the config for a chart a modified version of the default color is used. If the background color is a CanvasPattern object an error is triggered.

With this change the default background color will no longer be modified if it is a CanvasPattern.
2016-05-07 22:24:00 +01:00
Evert Timberg
cf5c75ea9e get a little more from the point element 2016-05-07 17:09:17 -04:00
Evert Timberg
5141c90c7b Revert unnecessary changes 2016-05-07 17:04:34 -04:00
Evert Timberg
72c791f352 Revert "Reduce element.point size"
This reverts commit 09bcac9b5c.
2016-05-07 17:00:00 -04:00
Evert Timberg
bc505b1a9d beginAtZero and linear scales with no data should play nice 2016-05-07 16:56:04 -04:00
Evert Timberg
33c7dbafd6 Use local variables + don't include text width for vertical scales with mirrored text 2016-05-07 16:26:44 -04:00
Evert Timberg
d13e7905dc Scales should have 0 cross size when not displayed 2016-05-07 14:18:36 -04:00
Evert Timberg
fc4c23c8d2 Allow updating scale defaults 2016-05-07 11:43:24 -04:00
Evert Timberg
8d88e9c3b7 Fix time scale grid lines 2016-05-06 07:57:28 -04:00
Evert Timberg
c4bff1602e Fix line tension drawing, especially when set to 0 2016-05-06 07:19:38 -04:00
Evert Timberg
1b6ffd623c Core.Title reductions 2016-05-05 21:01:48 -04:00
Evert Timberg
655163a7f5 Doughnut controller size reductions 2016-05-05 20:47:33 -04:00
Evert Timberg
09bcac9b5c Reduce element.point size 2016-05-05 20:00:11 -04:00
Evert Timberg
8f6f882068 Fix jshint issue 2016-05-04 22:16:07 -04:00
Evert Timberg
4258137171 Size reduction for elements 2016-05-04 22:08:55 -04:00
Evert Timberg
3c33cdf760 core dataset controller update 2016-05-04 21:32:40 -04:00
Evert Timberg
4068836a42 Reduce core.title.js size 2016-05-04 21:08:59 -04:00
Evert Timberg
5ca07b84f0 Minor legend fix when going to next line 2016-05-04 21:06:19 -04:00
Evert Timberg
7de70c292d Plugin system is slightly smaller 2016-05-04 19:35:01 -04:00
Evert Timberg
eeae8a6a16 Reduce size of on-canvas legend 2016-05-04 19:28:22 -04:00
Evert Timberg
d383e89222 Merge pull request #2416 from brizido/fix-tooltip-body
Fix tooltip body
2016-05-04 16:34:29 -04:00
potatopeelings
c2cc3fbb4c Feature #73 - Horizontal Bar Chart (#2448)
* Horizontal bar chart type

* Mentioned horizontal bar chart in bar documentation

* Sample file for horizontal bar chart

* Missing semicolon

* Fix for borderSkipped index
2016-05-03 16:45:43 -05:00
Evert Timberg
38373300ee Improve time scale for zoom and pan
* Improve time scale for zoom and pan
Improve category scale when zoomed

* Fix CI test
2016-05-01 11:40:14 -05:00
Evert Timberg
cb54f30c97 Implement getValueForPixel for category scale 2016-04-30 08:39:18 -04:00
Evert Timberg
6df9b24ecd Merge from feature/pan-support
All tests are passing
2016-04-29 20:03:15 -04:00
Ricardo Brizido
314f398887 Fix tooltip body 2016-04-29 12:11:15 +01:00
Evert Timberg
405fda6655 Fix radar tests & reenable. support new lineTension attribute like line controller 2016-04-27 19:03:52 -04:00
Evert Timberg
6abc9a9020 Merge pull request #2394 from Lighnat0r/master
Update time scale range only for visible datasets
2016-04-27 17:24:23 -04:00
Lighnat0r
200abc184b update isDatasetVisible call 2016-04-27 23:18:03 +02:00
Evert Timberg
03fb66751f Make animation options consistent for polar area and doughnut charts (#2342)
* Make animation options consistent and fix an issue when `animateRotate === false` in the polar area chart

* Update docs for moved options

* Fix typo
2016-04-27 16:07:21 -05:00
Lighnat0r
6b32466a19 update time scale range only for visible datasets 2016-04-27 22:46:49 +02:00
Evert Timberg
450a08420b Merge pull request #2371 from chartjs/fix-time-scale-cutoff-bug
Time scale now compensates for rounded tick units
2016-04-27 15:39:02 -04:00
Simon Brunel
aa0933e040 Avoid meta data access in calculateCircumference
Fix access of uninitialized meta data while calculating circumference in the polar area chart by caching the number of visible elements in the update() method. Also make the calculateTotal() of the doughnut chart tolerant of uninitialized meta data.
2016-04-26 12:46:30 +02:00
Simon Brunel
29115c9d2c Handle data visibility per chart
New Chart.Element.hidden bool flag storing the visibility state of its associated data. Since elements belong to a specific chart, this change allows to manage data visibility per chart (e.g. when clicking the legend of some charts).

This commit also changes (fixes?) the polar chart animation when data visibility changes. Previous implementation was affected by an edge effect due to the use of NaN as hidden implementation.
2016-04-26 12:46:29 +02:00
Simon Brunel
82b1e5cd99 Handle effective dataset visibility per chart
Introduced a new meta.hidden 3 states flag (null|true|false) to be able to override dataset.hidden when interacting with the chart (i.e., true or false to ignore the dataset.hidden value). This is required in order to be able to correctly share dataset.hidden between multiple charts.

For example: 2 charts are sharing the same data and dataset.hidden is initially false: the dataset will be displayed on both charts because meta.hidden is null. If the user clicks the legend of the first chart, meta.hidden is changed to true and the dataset is only hidden on the first chart. If dataset.hidden changes, only the second chart will have the dataset visibility updated and that until the user click again on the first chart legend, switching the meta.hidden to null.
2016-04-26 12:46:27 +02:00
Simon Brunel
f3457c9941 Handle dataset type per chart
Dataset effective type is now stored under meta.type, allowing many charts to share the same dataset but with different types. Also move dataset.bar flag to meta.bar.
2016-04-26 12:46:26 +02:00
Simon Brunel
51aa9b4a27 Allow multiple charts sharing the same data
Meta info are now scoped by chart and moved under the dataset._meta map { chart.id -> meta }. Meta for a specific chart (and dataset) can be accessed using chart.getDatasetMeta(datasetIndex) or from the dataset controller using getMeta(). Note that helpers.uid() now generates an int (instead of a string) to make lookups in the _meta map faster.
2016-04-26 12:46:24 +02:00
Daan De Meyer
73493e2c9e Added default ("left") for position field in global scale defaults.
Documented scale position field in scale docs.
2016-04-26 03:09:35 +02:00
Tanner Linsley
da90e2f670 Time scale now compensates for rounded tick units
Closes #2277
2016-04-25 17:48:21 -05:00
Evert Timberg
ae33b1ee54 Merge pull request #2343 from nnnick/fix/2152
Only update the size of boxes that are not full width
2016-04-24 09:40:34 -04:00
Evert Timberg
bbd4364f64 Only use valid label moments 2016-04-24 09:14:21 -04:00
Evert Timberg
38812cd3c4 Only update the size of boxes that are not full width 2016-04-24 08:20:36 -04:00
Evert Timberg
b4a06f6e34 Merge branch 'master' into feature/pan-support
Conflicts:
	src/core/core.controller.js
2016-04-23 20:06:18 -04:00
Evert Timberg
47552152c3 Remove file and fix jshint error 2016-04-23 19:39:37 -04:00
Evert Timberg
c31c90b2e4 Backwards pixel to value API 2016-04-23 13:27:10 -04:00
Evert Timberg
8f0caed24b Fix adding data to pie, doughnut, and polar area charts 2016-04-23 10:52:02 -04:00
Evert Timberg
32db92c7e1 Merge pull request #2314 from jachstet-sea/consistent_option_names_pt1
Consistent option names pt1
2016-04-22 22:52:34 -04:00
Evert Timberg
f6f8fe5959 Add in a beforeRender plugin event. Makes it easier to handle things that need to happen once at the start of animation but not on every frame 2016-04-22 21:04:55 -04:00
Evert Timberg
18e3b891d9 Remove commented code 2016-04-22 20:49:44 -04:00
Evert Timberg
dc7ad19f29 Support radar tooltip mode 'label' 2016-04-22 20:48:41 -04:00
Jake
bca5bd874d Merge pull request #2329 from zachpanz88/build-fix
Fix build to include comment at top of file
2016-04-22 11:07:23 -04:00
Zach Panzarino
900d249646 Fix build to include comment at top of file 2016-04-22 15:03:52 +00:00
John Walker
87966a1b58 Scaled bar width fix
Add logic for calculating bar width when ticks are less than the data labels
2016-04-22 14:59:28 +01:00
Jan Potoms
58563fddf9 Fix typo in plugin 'destroy' 2016-04-21 17:25:37 +02:00
Jannis Achstetter
0e61361e74 Rename dataset-specific options "radius" to "pointRadius" and "hitRadius" to "pointHitRadius", adding compatibility-clauses to support the old names as well 2016-04-21 15:40:19 +02:00
Evert Timberg
76b3494a0a Fix build and update to latest node js version. 2016-04-21 07:50:20 -04:00
Evert Timberg
bc90aaa522 Start on pan support 2016-04-21 07:48:47 -04:00
Jannis Achstetter
bc0f0f0fa7 Rename dataset-specific option "tension" to "lineTension" and add a compatibility-clause to support the old name as well 2016-04-21 09:40:45 +02:00
Jannis Achstetter
b0c1e9cb69 "tension" is a property of the line, not of the point 2016-04-21 09:17:51 +02:00
Peter
6c50cb0fc0 Fixed closing span position
In the pie/doughnut legendCallback function the <span> is not closed immediately so that the text is written in the <span> instead of the <li>
2016-04-20 13:55:58 +02:00
Evert Timberg
9abc63b11e Plugin event in destroy 2016-04-17 18:55:20 -04:00
Evert Timberg
d131e7d07a Use apply instead of call so that the animation easing can be passed to the draw callbacks 2016-04-17 12:25:47 -04:00
Evert Timberg
7fa4c4c1b8 Initial plugin calls 2016-04-17 12:02:42 -04:00
Evert Timberg
16570b0c0c Plugin system + tests 2016-04-17 12:02:33 -04:00
Evert Timberg
7c7739c25f Merge pull request #2276 from nnnick/fix/2229
Improved sizing when grid lines are not display
2016-04-17 10:38:45 -04:00
Evert Timberg
1a49872ce4 More prework for zoom/pan 2016-04-17 10:33:38 -04:00
Evert Timberg
0e33b6b556 Update doughnut and polar area legend callbacks to handle when the background color is not set. 2016-04-17 08:38:46 -04:00
Evert Timberg
58d18d6a48 Add configurable tick mark length. Use it to calculate appropriate sizing 2016-04-16 21:46:29 -04:00
Evert Timberg
b50c281684 Merge pull request #2273 from mdehoog/doughnut-rotation
Added unit test for doughnut rotation/circumference, fix for rotation = 0
2016-04-16 19:21:58 -04:00
Michael de Hoog
241f085533 Fix for doughnut rotation = 0, added unit test for doughnut rotation/circumference properties 2016-04-17 09:16:42 +10:00
Tanner Linsley
4f60eecc01 Better default tick rotation and tick autoskip settings (#2258)
* Better default tick rotation and tick autoskip settings

* scale.time: Use ctx to measure label, and <= instead of < for unit fitting

* Test Changes

* Passing Tests with new defaults
2016-04-16 17:38:03 -05:00
Michael de Hoog
d3a29967e2 Added rotation and circumference properties to doughnut/pie charts 2016-04-17 00:23:48 +10:00
Simon Brunel
5836c19ec5 Optimize animation frame requests (#2268)
The animation service now keeps track of the active animation frame request and will skip new requests until the current one is executed. This can happen when processing mouse events, e.g. 'mousemove' and 'mouseout' events will trigger multiple renders.
2016-04-15 20:15:54 -04:00
dibsyjr1
5aa16a67c1 Fixed the generateLegend function
Fixed the generateLegend function to create the colour block next to the text instead of around it.
2016-04-13 16:03:08 +01:00
Tom Duncalf
0c854dd40c Allow gradients to be used as colors without causing errors when e.g. calling the color helper to generate the defualt colour value for hover 2016-04-13 09:46:39 +01:00
Evert Timberg
68b493732c Don't measure undefined or null strings. 2016-04-10 10:10:31 -04:00
Evert Timberg
d5fd737058 Merge pull request #2206 from nnnick/fix/constraint-width-percent
Allow percentages as the max-width/max-height of the container
2016-04-03 13:18:06 -04:00
Evert Timberg
a7fede4f46 Fix jshint error 2016-04-03 09:15:11 -04:00
Evert Timberg
9ee70d6d48 Category scale supports min / max 2016-04-02 23:05:48 -04:00
Evert Timberg
95bd0a54dd Clip out the chart area so that things outside do not draw 2016-04-02 21:41:57 -04:00
Evert Timberg
3350d5fb13 Refactoring to reduce code size 2016-04-02 09:19:33 -04:00
Evert Timberg
b6d7ceba1c Add initial implementation of constraint percentage width / height support. Added tests for dom sizing methods. 2016-04-01 23:11:01 -04:00
etimberg
d8347039cf Better handling when data.datasets does not exist 2016-03-29 20:10:29 -04:00
Blake Niemyjski
798f643fab Removed the default padding
You should put a style on the container element
2016-03-24 14:07:35 -05:00
etimberg
79f38b49d8 Fix scale merge when the xAxes object is specified but the type is not 2016-03-20 11:12:26 -04:00
Evert Timberg
e090691ef7 Better use of default scale types. 2016-03-19 08:50:50 -04:00
etimberg
998c6939bf Instead of showing a warning on load, throw an error on create if moment is not defined. 2016-03-16 19:59:20 -04:00
etimberg
21a33f0e41 Better conversion to ticks to make it easier to use callbacks 2016-03-16 19:39:09 -04:00
Evert Timberg
04f1e57459 Fix zoom reset 2016-03-15 20:03:28 -04:00
Evert Timberg
e511fc2a1c Merge pull request #2128 from The-Smallest/v2-rectangle-generic
Generic Rectangle: any border (botton, left, top, right) can be skipped now.
2016-03-13 14:06:31 -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
Ivan Samoylenko
81e1448836 Added 'borderSkipped' parameter to Rectangle. 2016-03-13 18:58:36 +03: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
9bcc3ca34c Allow ticks.fixedStepSize or ticks.stepSize options to mean the same thing 2016-03-06 08:56:31 -05:00
Evert Timberg
c3f765857e Fix some time rounding problems 2016-03-05 22:58:34 -05:00
Matthias Winkelmann
b69b388b31 fixed travis built 2016-03-02 14:16:52 +01:00
Matthias Winkelmann
d5f837843e Fixes nnnick/Chart.js#2086 by introducing a new time.parser option with high priority to replace the (deprecated) time.format 2016-03-02 13:53:35 +01:00
Evert Timberg
3d6b47b0d5 Fix legend generation when no datasets 2016-02-28 17:51:06 -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
Evert Timberg
1cc9184c47 Merge pull request #2066 from mathiask88/cacheCleanupFix
Much faster cache clean up
2016-02-27 12:00:44 -05:00
Mathias Küsel
96315dd3c9 Much faster cache clean up 2016-02-27 17:19:33 +01:00
Evert Timberg
b812bcc8a5 Fix #2009 2016-02-27 08:58:27 -05:00
Ville Hämäläinen
0f6e329aaa fix alpha for tooltip colors 2016-02-25 20:17:40 +02:00
Evert Timberg
f5a2e394c8 Fix radius 0 2016-02-20 08:44:25 -05:00
Mathias Küsel
86b9139617 Adds the ability to draw custom point styles 2016-02-18 22:03:20 +01: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
309ab1f477 Disable autoskipper for time scales 2016-02-15 09:41:35 -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
098b05f1b2 Further reformatted scale.linear.js to match original indenting.
Refactored and fixed scale calculation.
Added dist files to commit.
2016-02-05 09:41:45 +01:00
Robert Becker
85de9fbe9c Further reformatted scale.linear.js to match original indenting. 2016-02-05 09:33:57 +01:00
Robert Becker
80ede9b9bb Added documentation for fixedStepSize.
Reformatted scale.linear.js to match original indenting.
2016-02-05 09:28:50 +01:00
Robert Becker
09721407d2 Removed debug log. 2016-02-04 15:28:06 +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
0e8babf1d7 Fix stacked bar data limit calculation 2016-02-01 18:44:39 -05:00
Evert Timberg
172c088c6b Minor fix 2016-01-30 17:19:32 -05:00
Evert Timberg
f75116a91e Update millisecond default format. Removed unnecessary space at right edge of time scale. 2016-01-30 16:35:10 -05:00
Evert Timberg
bfd6f5f78e Radar controller tests 2016-01-27 18:00:32 -05:00
Evert Timberg
d0a0d57fe2 Initial polar area tests 2016-01-24 13:29:13 -05:00