Commit Graph

40 Commits

Author SHA1 Message Date
Evert Timberg
a84347b035
Handle animating stacked bars from null values (#8872)
* Handle animating stacked bars from null values

* Skipped bars / points should be in the reset state
2021-04-10 20:31:14 +03:00
Jukka Kurkela
81342d6c65
Fix _isPointInArea for undefined point (#8678) 2021-03-19 16:09:13 -04:00
Jukka Kurkela
79cc6d3206
Use maxOverflow as minimum layout padding (#8650)
* Use maxOverflow as minimum layout padding

* fixes
2021-03-16 16:32:29 -04:00
Jukka Kurkela
8d6e87881a
Relocate chart type and dataset type defaults (#8563)
* Relocate chart type and dataset type defaults

* Update types

* Separate overrides and descriptors

* Update derived sample, use merge for inherit

* Don't merge overrides

* Review update
2021-03-06 10:34:52 -05:00
Jukka Kurkela
a8329e4f13
Update chartjs-test-utils to v0.2.1 (#8407)
* Update chartjs-test-utils to v0.2.0

* to 0.2.1
2021-02-10 16:17:08 +02:00
Jukka Kurkela
ddfbcf777a
Update eslint-config-chartjs to v0.3.0 (#8406) 2021-02-10 08:21:39 -05:00
Jukka Kurkela
505afa7f13
Fix element creation for large dataset (#8388)
* Fix element creation for large dataset
* Fix syncing
* Remove duplication
2021-02-05 17:53:05 -05:00
Jukka Kurkela
913a01a3a6
Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins

* Update tooltip.md

* Update legend.md and title.md

* Add migration notes

* typo

* Types

* Restore plurals

* One more s, restore tabs

* All plugins disabled

* lint

* cc
2020-11-25 08:50:12 +02:00
Jukka Kurkela
e3ad31893d
Restore datasets namespace (revert 6955) (#8090) 2020-11-24 22:27:51 +02:00
Jukka Kurkela
ff76a236bf
Rename lineTension back to tension (#7978) 2020-10-31 14:54:14 +02:00
Jukka Kurkela
4f2511aff3
Relocate dataset defaults to defaults.controllers (#7979) 2020-10-30 18:34:32 -04:00
Jukka Kurkela
6a72bcbeca
Rename showLines to showLine (#7936) 2020-10-21 08:13:27 -04:00
Evert Timberg
bc11f10216
Rename elements to mark as elements, i.e. Arc -> ArcElement (#7924)
* Rename elements to mark as elements, i.e. Arc -> ArcElement
* Rename RectangleElement to BarElement
* Also updates options.elements.rectangle to options.elements.bar
2020-10-20 08:18:56 -04:00
Jukka Kurkela
689befa807
Make sure bezier control points are updated (#7710)
* Make sure bezier control points are updated
* Test
2020-08-15 17:06:03 -04:00
Jukka Kurkela
91164e8c66
Line hide (#7612)
* Add support for description in fixtures
* Update datasetController to draw active(s) last
* Handle hiding of line by borderWidth
* Disable filling of scatter charts by default
* Make radar chart consistent with line
2020-07-13 13:20:05 -04:00
Jukka Kurkela
fa79eb8797
Switch from chartjs-color to @kurkle/color (#7059) 2020-02-07 19:24:29 -05:00
Jukka Kurkela
a1c2dd6fb6 Throttle all events (to 1 / frame each) (#6953)
* Throttle all events
* Asynchronize event tests
2020-01-14 07:34:08 -05:00
Ben McCann
9bd2af9e9b Move location of dataset options (#6955)
* Move location of dataset options
* Fix misplaced period
2020-01-13 19:39:30 -05:00
Jukka Kurkela
f1677b6652 Limit interactions to chartArea (+/-0.5px) (#6943)
Limit interactions to chartArea (+/-0.5px)
2020-01-11 18:10:32 -05:00
Jukka Kurkela
f4792306e0 Remove global from defaults (#6893) 2020-01-03 14:07:38 -05:00
Jukka Kurkela
b83f64b16e Rewrite animation logic (#6845)
* Rewrite animation logic

* Review update 1

* Review update 2

* Review update 3

* Add 'none' to api.md
2019-12-27 17:13:24 -05:00
Ben McCann
6f6005d7b8 Shrink _parsed to match if dataset shrinks (#6826) 2019-12-10 18:57:21 -05:00
Jukka Kurkela
ce74eb76a1 Convert axis options from arrays to objects (#6773)
* Convert axis options from arrays to objects

* Updated all chart type defaults
* Throw errors when axis type or position are not specified
* Avoid raising unnecessary errors when merging options into the default configs

* Fix additional tests

* Ensure scale defaults are set if type is not explicitly defined

* Another step

* Include `scale` as `firstIDs.r`

* update docs

* Update for buildOrUpdateScales

* Update migration guide

* Add test back
2019-11-21 18:46:49 -05:00
Jukka Kurkela
7f97adf5a0 Move scale defining options up from ticks (#6738)
* Move scale defining options up from `ticks`
* Include `ticks.reverse` in v3-migration
2019-11-15 12:11:13 -05:00
Ben McCann
09ef08acfe Remove Element _index and _datasetIndex for real this time (#6726)
* Remove Element _index and _datasetIndex for real this time

* Remove unused _datasetIndex
2019-11-12 19:18:29 -05:00
Jukka Kurkela
0228776e66 Remove deprecated interaction modes (#6625)
* Remove deprecated interaction modes
* Use default modes
2019-10-28 18:11:38 -04:00
Ben McCann
08d133817b Remove xLabel and yLabel from tooltip and chart and scales from element (#6606)
* Element should not have reference to chart
* Remove scales from element
* Remove deprecated xLabel and yLabel
2019-10-27 16:35:15 -04:00
Ben McCann
0da237a315 Remove undocumented "custom" feature (#6605)
Remove undocumented "custom" feature
2019-10-27 16:33:21 -04:00
Jukka Kurkela
333118bff6 Hover styling for dataset in 'dataset' mode (#6527)
* Hover styling for dataset in 'dataset' mode
2019-10-25 13:22:37 -04:00
Ben McCann
d6a5ea0d36 Implement per-dataset type (default and per-chart) options (#5999) 2019-05-06 22:52:40 +02:00
Evert Timberg
a655da076e Implement scriptable options for points in line charts (#5973) 2019-01-15 09:24:12 +01:00
Simon Brunel
be8d78a900
Make Chart.controllers.* importable (#5871)
`controllers.*.js` and `core.datasetController.js` are now importable (no more function export), that's why there is so many changes mainly due to one indentation level removed. Split code for `bar/horizontalBar` and `doughnut/pie` in separate files, added a global controllers import (`src/controllers/index.js`) and add tests to check that all dataset controllers are correctly registered under `chart.controllers.{type}`.
2018-11-29 21:06:34 +01:00
Simon Brunel
2dbf1cd1af
Add support for *.js test fixture config (#5777)
JSON doesn't support functions which are needed to create scriptable options, so implement a very basic method to load a JavaScript file exporting the config in `module.exports`. Also rename test sources (remove the `jasmine.` prefix), cleanup `karma.conf.js` and add an example .js fixture config (bubble radius option).
2018-10-20 11:38:48 +02:00
Simon Brunel
91608398b6 Add "point style" image tests
Replace the old style canvas "mock" context checks by image based unit tests which are easier to maintain and allow more flexibility in the drawing logic since we are not testing the context calls but the final painted result.
2018-07-29 22:43:23 +02:00
Ben McCann
da3aa68f38 Restore original styles when removing hover (#5570)
Refactor `updateElement` and `removeHoverStyle` and fix tests.
2018-06-26 08:56:53 +02:00
andig
2f950e2ab3 Improve controller tests stability (#4698) 2017-08-27 22:43:16 +02:00
Akihiko Kusanagi
7dc71d009b Make offsetGridLines consistent and add new offset scale option (#4545)
Add a new `offset` option to scales to add extra space at edges and remove the `includeOffset` argument from `getPixelForValue()` and `getPixelForTick()`. The bar controller now automatically calculates the bar width to avoid overlaps. When `offsetGridLines` is true, grid lines move to the left by one half of the tick interval, and labels don't move.
2017-08-14 10:09:33 +02:00
Evert Timberg
cc9e88aebc Support an array for line chart pointBorderWidth 2017-07-04 07:24:37 -04: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
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