Commit Graph

921 Commits

Author SHA1 Message Date
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