Commit Graph

2491 Commits

Author SHA1 Message Date
etimberg
222479c5c7 Update the tooltip with a new caretPadding setting. Previously this value was essentially hard coded to
2 because of a typo that read it from the positioner output. Based on #3599 we agreed to make this into
a config setting.
2017-03-28 18:17:26 -04:00
Martin Zürn
6f99157eb8 Fixed misplaced data points on category scale
* Fixed issue, that category scale shows data points misplaced. See #4060
* Cleaned code
* Fixed Irregular whitespace
* Fixed error in case value is undefined
* Verified that no error is thrown in case value === null
2017-03-27 18:02:56 -04:00
Simon Brunel
f3816b560c Move legend and title in the plugins folder (#4076) 2017-03-25 18:28:54 +01:00
Simon Brunel
e3f3b8978b Add gulp unittest --coverage argument (#4075)
Coverage data are now generated by running `gulp unittest` with the `--coverage` argument: unit tests are then executed a single time on Travis. The gulp `coverage` task has been removed and `karma.coverage.conf.ci.js` merged into `karma.conf.ci.js`.

Update documentation with gulp commands (and remove them from `README.md`) and remove unused `config.jshintrc` (oversight from #3256). Delete `thankyou.md` which has been merged into `README.md`.
2017-03-25 18:26:45 +01:00
y-take
90d458a6d9 Add link to plugin that creates a stacked percentage chart 2017-03-24 18:57:08 -04:00
ellie
c96ad66945 Update line-customTooltips.html (Re issue #4038 )
Add window scroll position to tooltip position calculation so they show up in the intended place instead of potentially off-screen! Moved tooltips inside the canvas parent container since they are being positioned in terms of its location
2017-03-22 06:35:50 -04:00
Lee N Dobryden
20a832809e Zero line dash options (#4019)
* Add of zero line border dash options
* Update Readme with zero line border dash config options
2017-03-21 06:38:09 -04:00
Simon Brunel
6e57405a0a Reorganize samples and list them in index.html (#4043) 2017-03-20 20:40:44 -04:00
Samuel Jo
8367f90df0 Do not draw tooltips that have no items (#4034) 2017-03-20 20:40:28 -04:00
Hiroshi Shirosaki
cffa9447a1 Fix radar chart horizontal position (#4032)
Radar chart position is not center horizontally with v2.5.0.

Right and left of `furthestLimits` would be switched wrongly on
this refactoring commit.
e1606f88ed
2017-03-20 20:39:18 -04:00
Evert Timberg
36ccf40946 Fix for stacked bar charts with log axes (#4010)
* Undo fix for #3585 since it has broken the stacked bar charts when the axis has a user defined minimum value.

* When a value of 0 is requested for a vertical logarithmic axis, return the bottom point
2017-03-20 20:38:15 -04:00
Bohdan Khorolets
da1d1ca512 Avoid errors when rendering serverside (#3909) 2017-03-20 20:37:34 -04:00
Evert Timberg
3e94b9431a Update the docs structure/content to use GitBook (#3751)
Update the docs structure/content to use GitBook
2017-03-20 20:36:54 -04:00
Simon Brunel
bd60fa2dfd Correctly handle decimal display size (#4009)
Fix the `readUsedSize` regular expression to correctly parse (truncate) pixel decimal values.
2017-03-18 11:54:56 +01:00
Simon Brunel
4b421a50bf Add support to fill between datasets (#4008)
The `fill` option now accepts the index of the target dataset (number) or a string starting by "+" or "-" followed by a number representing the dataset index relative to the current one (e.g. `fill: "-2"` on dataset at index 3 will fill to dataset at index 1). It's also possible to "propagate" the filling to the target of an hidden dataset (`options.plugins.filler.propagate`). Fill boundaries `zero`, `top` and `bottom` have been deprecated and replaced by `origin`, `start` and `end`.

Implementation has been moved out of the line element into a new plugin (`src/plugins/plugin.filler.js`) and does not rely anymore on the deprecated model `scaleTop`, `scaleBottom` and `scaleZero` values. Drawing Bézier splines has been refactored in the canvas helpers (note that `Chart.helpers.canvas` is now an alias of `Chart.canvasHelpers`).

Add 3 new examples and extend utils with a pseudo-random number generator that can be initialized with `srand`. That makes possible to design examples starting always with the same initial data.
2017-03-18 11:08:57 +01:00
Simon Brunel
1ca0ffb5d5 Introduce unit test based on image comparison (#3988)
Attempt to make easier the creation of unit tests that check the drawing output. Until now, this was done by checking calls on a 'fake' context, which is hard to maintain (need to update pixel values by hands) and also not reliable when optimizing code (i.e. different calls sequence but same result).

As of now, it's possible to define 'auto' tests based on JSON/PNG fixtures: chart is generated from the JSON file and compared to the associated PNG image. The image diff is done using `pixelmatch`. As an example (and in preparation of the `filler` plugin), add auto tests for the line element `fill` options.
2017-03-05 09:49:12 -07:00
Simon Brunel
c216c0af76 Cleanup and upgrade unit tests environment
`karma.conf.ci.js` has been merged into `karma.conf.js` for local testing consistency: `gulp unittestWatch` has been replaced by `gulp unittest --watch` and thus use exactly the same config file. Upgrade to latest jasmine and karma packages and remove deprecated `gulp-karma` dependency (directly use `karma.Server` in gulp).

Split `test/mockContext.js` into smaller `test/jasmine.*` modules to make easier unit tests maintenance and finally, move all `*.test.js` files under the `test/specs` folder.
2017-03-04 11:39:48 -05:00
Simon Brunel
b4dfa38731 Fix shorthand legend: false and title: false
Prevent attempt to remove the legend or title layout items if they haven't been created but also check if the item to remove is registered with the layout manager to avoid removing the wrong box `splice(-1, 1)`. Add ids to the legend and title plugins to allow to fully disable them (`options: {plugins: {legend: false, title: false}}`).
2017-03-04 09:13:42 -05:00
Cătălin Pintea
5234899323 Added a maxBarThickness setting for bar charts xAxis (#3963)
Added a `maxBarThickness` setting for bar charts xAxis
2017-03-03 19:21:48 -05:00
Evert Timberg
a3b8fb266a Split radial scale lineArc setting into a combination of existing and new settings.
gridLines.circular is a new option that toggles circular lines. This allows radar charts with circular lines #3082
pointLabels.display is a new option that toggles the display of point labels.
The existing angleLines.display is used with the new pointLabels.display setting is used to trigger the radar like settings.
This required changing the default polar area config.
2017-03-03 06:50:34 -05:00
Simon Brunel
b92b256872 Flatten animation object and fix callbacks
Animation callbacks now receives `animationObject` directly with a reference on the associated chart (`animation.chart`), which deprecates `animation.animationObject` and `animation.chartInstance`. Also fix missing `onComplete` animation argument and make sure that an animation object is passed even when animations are disabled.
2017-03-03 06:49:47 -05:00
Simon Brunel
d25e7b1e1a Handle incoming model values on element transition
If a value is set on the model after `pivot()` has been called, the view wasn't initialized and the animation started from 0. Now, `_start` and incomplete `_view` are initialized to the model value during the transition (no initial implicit transition).

Also remove exception handling when animating a string (color), which is faster when string are not valid colors (e.g. tooltip position). It requires to update `chartjs-color` to version 2.1.0.
2017-03-03 06:49:32 -05:00
Jerry Chang
05e63824b3 Fixed built-in auto skip caused by previous commit (#3904) 2017-02-25 12:12:41 -05:00
etimberg
b50eac366d Add test for layout service weight ordering 2017-02-25 12:10:27 -05:00
etimberg
0c642720d4 Layout service supports a new order setting to configure how boxes are ordered on left and right edges 2017-02-25 12:10:27 -05:00
Evert Timberg
2ddd5ff88c Fix use of reserved keyword as a parameter name 2017-02-25 08:05:05 -05:00
Adam Kirk
1e14124d55 fading tooltip 2017-02-24 19:27:05 -05:00
Marcelo Tedeschi
f97cab12b1 Refactored drawCaret and drawBackground functions to draw the background together with the caret in the same path 2017-02-24 19:27:05 -05:00
Marcelo Tedeschi
a038459d8c Added configuration to documentation 2017-02-24 19:27:05 -05:00
Marcelo Tedeschi
af11be3ce4 Added possibility to draw tooltip borders 2017-02-24 19:27:05 -05:00
Evert Timberg
e519ea399d Fix color dependency for builds 2017-02-21 20:45:56 -05:00
Simon Brunel
4741c6f09d Add new dataset update and draw plugin hooks
In order to take full advantage of the new plugin hooks called before and after a dataset is drawn, all drawing operations must happen on stable meta data, so make sure that transitions are performed before.
2017-02-21 20:28:16 -05:00
Simon Brunel
cc90c5c643 Add chart data property setter and unit tests
Chart data can now be entirely replaced using `chart.data = {...}` thanks to the new property setter (instead of using `chart.config.data = {}`). Also update the documentation, as suggested by @ldaguise and @kennethkalmer, with a note about versions prior 2.6.
2017-02-18 11:53:39 -05:00
potatopeelings
85ee592b2a #3849 - Stack bars in z dimension 2017-02-16 17:58:18 -05:00
etimberg
8dafbc02c0 when axes are in the wrong place, update the config position 2017-02-12 11:23:17 -05:00
Evert Timberg
fed42e218a When the dataset label is not defined, the tooltip label string should not include a ':' character. Added a test to cover this case. 2017-02-10 19:30:52 -05:00
Jerry
8f217182b8 Update tooltip only when active element has changed (#3856)
Resolves #3746
2017-02-10 18:51:37 -05:00
Thomas Redston
9f3b51a80c Reuse parsed results rather than redoing work
The input labels/data is converted into moments in `determineDataLimits`, reuse them instead of duplicating the work.
2017-02-10 18:49:35 -05:00
Jerry Chang
074ab2aa87 Fixed HorizontalBar: stacked axis, displays NaN when all legends
unselected (#3770)

added ability to take snapshot of chart limits in order to be used
when max and min value is not finite

added ignore files
2017-02-10 18:40:37 -05:00
Simon Brunel
ba6e041713 Unit tests for Chart constructor and deprecations 2017-02-10 18:37:56 -05:00
Simon Brunel
28ea6c4967 Rename chartInstance to chart 2017-02-10 18:37:56 -05:00
Simon Brunel
13c6121876 Remove deprecated nested chart accesses 2017-02-10 18:37:56 -05:00
Simon Brunel
a0077d4117 Deprecate Chart.Controller (and nested chart) 2017-02-10 18:37:56 -05:00
etimberg
8c90b9f2de Fix issue with how Chart.PluginBase is defined 2017-02-09 17:36:32 -05:00
Matthisk Heimensen
6ff34a5d4a Added Django-Jchart link to docs/notes.md (#3865) 2017-02-03 18:17:33 -05:00
etimberg
9a3af51618 bump version number 2017-01-28 11:33:14 -05:00
Simon Brunel
7205ff5e2a Replace onEvent by before/afterEvent 2017-01-27 19:32:35 -05:00
Simon Brunel
1e9224d49c Make beforeDraw cancellable and fix easing value 2017-01-27 19:32:35 -05:00
Simon Brunel
979341ecb0 Plugin hooks and jsdoc enhancements
Make all `before` hooks cancellable (except `beforeInit`), meaning that if any plugin return explicitly `false`, the current action is not performed. Ensure that `init` hooks are called before `update` hooks and add associated calling order unit tests. Deprecate `Chart.PluginBase` in favor of `IPlugin` (no more an inheritable class) and document plugin hooks (also rename `extension` by `hook`).
2017-01-27 19:32:35 -05:00
Jakub Juszczak
c6fa4e5582 📝 Add vue-chartjs to docs
vue-chartjs is a wrapper written in vue for chartjs.
2017-01-27 08:05:08 -05:00