Commit Graph

324 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
8f0caed24b Fix adding data to pie, doughnut, and polar area charts 2016-04-23 10:52:02 -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
Jan Potoms
58563fddf9 Fix typo in plugin 'destroy' 2016-04-21 17:25:37 +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
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
58d18d6a48 Add configurable tick mark length. Use it to calculate appropriate sizing 2016-04-16 21:46:29 -04: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
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
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