Commit Graph

1130 Commits

Author SHA1 Message Date
Jukka Kurkela
0094a58ef1
Properly update stacks when datasets index changes (#9425) 2021-07-16 07:15:54 -04:00
Evert Timberg
11045a731a
Fix center axis title positions (#9413)
* Fix the title positions for center positioned axes

* Handle center position for vertical axes

* Tests
2021-07-15 08:20:22 -04:00
Jukka Kurkela
fb45d8aa95
Update a failing fixture (#9414) 2021-07-14 07:39:22 -04:00
Jukka Kurkela
58999ea7ac
Bar: inflate rects by 0.33px to avoid artifacts (#9399)
* Bar: inflate rects by 0.33px to avoid artifacts
* Update fixture
* YAGNI
2021-07-13 18:20:24 -04:00
Jukka Kurkela
c3e709e90e
Fix bar direction when minBarLength is applied (#9400) 2021-07-13 08:02:14 -04:00
Jukka Kurkela
31be610001
Fix stacked box dimension calculation with weights (#9394)
* Fix stacked box dimension calculation with weights

* Fix typo in filename
2021-07-12 07:45:03 -04:00
Jukka Kurkela
47d4b04836
Layout: support box stacking (#9364)
* Layout: support box stacking

* Add stackWeight and sample

* Cleanup, update docs and types

* Avoid div0

* missing semi
2021-07-11 06:23:42 -04:00
Evert Timberg
27b91b7458
Adjust legend hitboxes when RTL and each item has a different size (#9353)
* Adjust legend hitboxes when RTL and
each item has a different size

* Add test for RTL legend hitboxes
2021-07-10 18:36:46 -04:00
Evert Timberg
774c444cb9
Point label specific scriptable context (#9373) 2021-07-09 06:57:55 -04:00
Jukka Kurkela
066130be4d
Decimation: Prevent buffer overflow (#9367) 2021-07-07 17:45:31 -04:00
Jukka Kurkela
840599637f
Add 'shape' mode for filler-plugin (#9360) 2021-07-05 17:03:19 -04:00
Nico-DF
b4dee5507c
Adding threshold option to decimation plugin (#9327) 2021-07-04 13:19:35 -04:00
Jukka Kurkela
bb2bddcfd4
Timeseries: support panning (#9345)
* Timeseries: support panning

* Update

* Missing semi, reduntant variables.

* cc
2021-07-03 18:44:44 +03:00
Evert Timberg
fea3f20762
Account for floating point error in niceNum helper (#9343)
* Account for floating point error in niceNum helper
* Better solution
2021-07-01 15:07:32 -04:00
Evert Timberg
3934935caa
Enable pointStyle for doughnut, pie, and polar area charts (#9341)
* Enable pointStyle for doughnut, pie, and polar area charts

* Fix whitespace
2021-07-01 14:15:06 -04:00
Evert Timberg
3a790329c6
Ensure correct item is clicked when a horizontal legend is in RTL mode (#9340) 2021-07-01 14:14:05 -04:00
Jukka Kurkela
c6976e8975
New plugin: subtitle (#9294)
* New plugin: subtitle

* Fix naive error for multiple charts
2021-06-20 07:34:55 -04:00
Jukka Kurkela
87bd5785ff
Legend: fix layout padding handling (#9290) 2021-06-19 18:31:33 -04:00
Jukka Kurkela
ba5ebceca8
Bar: ignore not-grouped bars from group bar count (#9291) 2021-06-19 18:28:05 -04:00
Jukka Kurkela
8f98515f45
Refactor radialLinear scale and renderText helper (#9276)
* Refactor radialLinear scale and renderText helper
* Undo the big move to make review possible
2021-06-18 14:12:27 -04:00
Jukka Kurkela
a8d083ac24
Apply maxTicksLimit to grid when ticks are hidden (#9277) 2021-06-18 14:11:55 -04:00
Jukka Kurkela
4002694e26
Fix: Don't use clip/unclipArea when clip: false (#9286) 2021-06-18 14:11:33 -04:00
Jukka Kurkela
22c02ede02
Fix updating of active elements (#9261) 2021-06-12 14:19:33 -04:00
Evert Timberg
9db3680440
null or undefined should skip grid lines in the time scale (#9252)
* `null` or `undefined` should skip grid lines in the time scale

* Refactor implementation per code review
2021-06-12 10:47:14 -04:00
Evert Timberg
be011768fe
Fix rtl legend text alignment (#9199)
* Start fixing RTL

* Broken test

* Fix right alignment for horizontal legends
2021-06-01 18:36:55 +03:00
Jukka Kurkela
4ac38d033e
Make sure data is parsed before updateElements (#9187)
* Make sure data is parsed before updateElements
* Add test
2021-05-30 14:51:11 -04:00
Jukka Kurkela
9326309afd
Fix error when swapping dataset locations (#9183) 2021-05-30 07:39:00 -04:00
Evert Timberg
c853ca6942
Allow setting a constance spacing between arc elements (#9180) 2021-05-29 17:47:44 -04:00
Jukka Kurkela
db74d2f44c
Linear: Respect bounds option in tick generation (#9181)
* Linear: Respect bounds option in tick generation
* Remove leftover _filterBetween
2021-05-29 17:32:03 -04:00
Jukka Kurkela
188da82206
Fix clearStacks with custom scaleId (#9170) 2021-05-28 07:36:59 +03:00
Jukka Kurkela
03eb826f8c
Stop mutating arc state while drawing (#9153)
* Stop mutating arc state while drawing

* No need for default values

* Nits

* Remove #9152

* Use correct endAngle for clipping
2021-05-25 08:13:37 -04:00
Jukka Kurkela
1d047355e7
Fix: Arc getCenterPoint when full circle (#9152) 2021-05-24 16:14:35 -04:00
Jukka Kurkela
7265bb51d5
Update chartjs-test-utils and mis-sized fixtures (#9135) 2021-05-20 14:59:55 +03:00
Jukka Kurkela
a6f0b37dfe
Further improve linear tick collision estimation (#9129)
* Further improve linear tick collision estimation

* More tolerance

* Re-create fixtures

* And more tolerance
2021-05-20 10:01:47 +03:00
Evert Timberg
78009390ad
Show correct decimal places when using count but min is not an integer (#9122)
* Show correct decimal places when using count but `min` is not an integer
* Fix lint issues
2021-05-19 18:31:15 -04:00
Jukka Kurkela
939ffe02ab
Fix arc offset calculation (#9118) 2021-05-18 19:24:57 -04:00
Jukka Kurkela
749d1fc942
Fix animations when data is replaced (#9120) 2021-05-18 19:24:35 -04:00
Jukka Kurkela
a553d57033
Fix doughnut rotation on float edge cases (#9121) 2021-05-18 19:24:23 -04:00
Jukka Kurkela
d1a243efec
Delay data to elements synchronization to update (#9105) 2021-05-15 08:22:15 -04:00
Jukka Kurkela
fbff165942
Make sure context indices are up to date (#9101) 2021-05-14 17:16:22 -04:00
Akihiko Kusanagi
0ba5c70618
Support monotone cubic interpolation for vertical line charts (#9084)
* Support monotone cubic interpolation for vertical line charts

* Use more more intuitive veriable names
2021-05-14 17:07:26 -04:00
Jukka Kurkela
f1ca99bfd4
Fix setting options in array of objects (#9062)
* Fix setting options in array of objects

* CC
2021-05-12 23:08:17 +03:00
Jukka Kurkela
33c16382b3
Allow scale to auto-adjust it's min when stacked (#9045) 2021-05-07 15:48:55 -04:00
Jukka Kurkela
7c3a412887
Add includeBounds option for cartesian ticks (#9020)
* Add includeBounds option for cartesian ticks

* Types, test and fix

* lint

* Improve linear tick min/max collision detection

* Update comments
2021-05-07 09:03:37 +03:00
Jukka Kurkela
137b51d87d
Fix line segments with alignToPixel (#9042) 2021-05-06 21:06:40 -04:00
Jukka Kurkela
1a1e677699
Fix: Avoid negative layout dimensions (#9027) 2021-05-05 07:49:44 -04:00
Akihiko Kusanagi
dffc086ad4
Fix for enabling monotone cubicInterpolationMode when tension is 0 (#9008) 2021-04-30 08:14:13 -04:00
Jukka Kurkela
44e62e77ca
Improve linear tick generators collision estimation (#8983)
* Increase distance to min/max tick to 1/3 space

* Better estimation on linear tick collision

* Lint fix

* Remove unused change
2021-04-28 16:41:57 -04:00
Jukka Kurkela
eaa3a68cea
Add drawTime: beforeDraw option to filler (#8973) 2021-04-24 15:27:52 -04:00
Jukka Kurkela
0ad0d35c09
Fix skipNull for subsequent datasets (#8972) 2021-04-24 15:20:52 -04:00
Evert Timberg
b92f9e52fd
Only enable the bar borderRadius at the end of the stacks (#8941)
* Only enable the bar borderRadius at the end of the stacks
* Float bars always get borders enabled
* Tests
* Update documentation
2021-04-18 16:30:54 -04:00
Jukka Kurkela
3e319f79ab
Scale: draw border on separate layer after grid (#8936) 2021-04-18 07:38:46 -04:00
Prateek R Patil
c107f895aa
Fix for allowing parsing:false with stacks (#8934)
* Initial fix for allowing parsing:false with stacks

* Added test from #8935 as requested.

Co-authored-by: tinfoilpancakes <tfm357@gmail.com>
2021-04-18 07:28:56 -04:00
Evert Timberg
af7965fc31
Cartesian scale tick backdrop (#8931) 2021-04-18 12:49:22 +03:00
Evert Timberg
e29ba78cd1
Allow the events option to be changed at runtime (#8928) 2021-04-17 14:08:36 -04:00
Jukka Kurkela
ef4f504db9
Fix: Fill vertical lines (#8919) 2021-04-17 07:31:58 -04:00
Jukka Kurkela
853f094937
Scale: Make sure grace is applied only once (#8913)
* Scale: Make sure grace is applied only once
* Add description to fixture
2021-04-17 07:31:15 -04:00
Jukka Kurkela
9e06f90d14
Fix: Initialize data object when replaced (#8918) 2021-04-17 07:29:41 -04:00
Jukka Kurkela
8e535c574c
Skip ticks by callback value as documented (#8914) 2021-04-17 07:28:33 -04:00
Jukka Kurkela
f94e8828ae
Fix: don't draw segments out of bounds (#8911) 2021-04-16 17:14:55 -04:00
Jukka Kurkela
f8885ce7a2
Font validate style, move defaults to weight (#8877) 2021-04-10 15:58:11 -04:00
Jukka Kurkela
9e70913bed
Enable event filtering per plugin (#8876) 2021-04-10 15:18:30 -04:00
Evert Timberg
d6d189c804
Legend boxes support borderRadius (#8875) 2021-04-10 15:05:34 -04:00
Evert Timberg
7ee498e412
Tooltip colorbox supports configurable borderWidth, borderRadius, and dash effect (#8874)
* Start on extending tooltip style
* Correct borderRadius implementation
* Tests of updated tooltip styling
* Update docs
2021-04-10 13:37:22 -04:00
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
7fab66ccd1
Support mirror option on x-axis (#8867) 2021-04-10 09:01:38 -04:00
Jukka Kurkela
1ffdecfe68
Consider dynamically positioned scales for padding (#8868) 2021-04-10 08:58:39 -04:00
Jukka Kurkela
ba84cc5c2a
Filler: support segment backgroundColor (#8864) 2021-04-09 19:10:48 -04:00
Jukka Kurkela
4eb59454be
Allow styling of line segments (#8844)
Allow styling of line segments

* docs & sample
* Types
* update sample
2021-04-08 18:02:12 -04:00
stockiNail
7ae1064ab9
Apply scale context to ticks scriptable options instead of chart context (#8839)
* Fixes #8835

* context as argument because protected

* fixes test case on formatters

* reverts previous commits and sets the scale context in the scale init

* changes documentation about linear ticks, adding scriptable Yes
2021-04-07 16:45:39 -04:00
Nico-DF
ba3320ef19
Filtering data before decimation (#8843)
* Filtering data before decimation

Using only points between the currently displayed x-axis for the decimation algorithm.
Allows better resolution, especially if using a zoom

If data are outside range, they will not be displayed, hence the line graph will not show the trend at extremities

* Fix LTTB algorithm

* Adding test file

* Simplifying count algorithm for decimation plugin
2021-04-07 16:40:45 -04:00
Jukka Kurkela
c6473da16c
_boundSegments did not work on rising line (#8838) 2021-04-07 07:32:28 -04:00
Jukka Kurkela
e1ddaa8992
Dissociate border options from grid options (#8823)
* Dissociate border options from grid options
* Update docs
2021-04-04 14:19:07 -04:00
Jukka Kurkela
697e3ffde7
Fix: tick spacing when min=0 | niceMin or max=0 (#8811) 2021-04-04 07:03:48 -04:00
Evert Timberg
238bfa589c
Add the ability to change font color per legend item (#8800) 2021-04-03 11:55:27 -04:00
Jukka Kurkela
74f118818b
Proxy: Only create scopes when setting values (#8799) 2021-04-03 11:10:52 -04:00
Jukka Kurkela
1451e5aee6
Add ability to stack different dataset types (#8797) 2021-04-03 09:23:35 -04:00
Jukka Kurkela
6df7fae625
Add drawTime option to filler plugin (#8796) 2021-04-03 08:13:00 -04:00
Jukka Kurkela
bd1df1bc34
Logarithmic: handle null/NaN values (#8793) 2021-04-03 08:01:48 -04:00
Evert Timberg
6f6b1b2d17
Doughnut/Pie chart border radius (#8682)
* Arc with rounded ends implementation
* End style option
* Working border radius implementation for arcs
* Linting
* Fix bug introduced when converting to new border object
* Fix bugs identified by tests
* Arc border radius tests
* Add test to cover small borderRadii
* Reduce the weight of the arc border implementation
* lint fix
2021-04-03 07:58:51 -04:00
Jukka Kurkela
515d941df7
Proxy: make sure set value ends up in first scope (#8787) 2021-04-02 13:47:05 -04:00
Jukka Kurkela
dd99005b5a
Remove line interaction overrides + hover.onHover (#8770)
* Remove interaction mode overrides + hover.onHover

* Restore bar override
2021-04-01 13:47:11 -04:00
Jukka Kurkela
9fb18c2fd7
Fix typo, add tests to catch (#8768)
* Fix typo, add tests to catch
* Tune tests
2021-04-01 11:11:14 -04:00
Jukka Kurkela
bc2c92e65c
Ensure scriptable context reflects updated data (#8765) 2021-04-01 07:17:02 -04:00
Evert Timberg
d2c8402445
Scriptable title plugin options (#8764) 2021-04-01 10:16:03 +03:00
Jukka Kurkela
f1810586f7
Pie: Fix last slice animation and NaN handling (#8760)
* Pie: Fix last slice animation and NaN handling

* Add tests

* Fix polarArea
2021-03-31 15:25:25 -04:00
Jukka Kurkela
1a5a15265a
Revert "Scale: draw offset grid for labels before autoSkip (#8748)" (#8752)
This reverts commit cdba66ccef.
2021-03-30 08:00:19 -04:00
Jukka Kurkela
cdba66ccef
Scale: draw offset grid for labels before autoSkip (#8748)
* Scale: draw offset grid for labels before autoSkip
* fix tests
2021-03-29 16:53:47 -04:00
Jukka Kurkela
64593ed74c
Time: Fix offset with low data counts (#8740) 2021-03-27 15:55:54 -04:00
Jukka Kurkela
b2c7baf10d
Avoid recursive event replay loops (#8738)
* chart._lastEvent = null while processing onHover

* Pass replay flag to external tooltip

* Add test for replay

* cc
2021-03-27 06:11:51 -04:00
Jukka Kurkela
396cbcb979
Bubble: Fix maxOverflow before elements update (#8736) 2021-03-26 18:20:05 -04:00
Evert Timberg
4d69a8510c
fix: Scales correctly respect the locale setting when generating labels (#8710) 2021-03-24 09:33:47 -04:00
Jukka Kurkela
bbf298f461
formatters.numeric: verify ticks length (#8705)
* formatters.numeric: verify ticks length
* use tickValue as fallback delta, add tests
* cc, chore
2021-03-23 16:14:22 -04:00
Jukka Kurkela
74f2f85ec3
Line: update all points when scale range changes (#8703) 2021-03-23 08:28:38 -04:00
Jukka Kurkela
e51a401449
Category: parse to valid index values only (#8697) 2021-03-22 17:20:03 -04:00
Jukka Kurkela
81342d6c65
Fix _isPointInArea for undefined point (#8678) 2021-03-19 16:09:13 -04:00
Evert Timberg
4ef04a8f78
Allow changing the aspect ratio (#8659)
* Allow changing the aspect ratio

* Add test and require `resize()` call

* Update to respect maintainAspectRatio
2021-03-18 23:07:32 +02:00
Jukka Kurkela
851861e9cc
Fix category scale invalid data handling (#8668)
* Fix category scale invalid data handling
* Fix NaN
2021-03-18 16:34:08 -04:00
Jukka Kurkela
97136d0cbf
Add textAlign for legend labels (#8665)
* Add textAlign for legend labels

* Update tests
2021-03-18 07:37:03 -04:00
Jukka Kurkela
f10b510890
Fix tooltip padding (#8666) 2021-03-18 07:27:37 -04:00
Jukka Kurkela
282c85827a
Re-enable oversized boxes (#8662) 2021-03-18 07:12:43 -04:00
Jukka Kurkela
416062bf68
Update tick positioning (#8657)
* Update tick positioning
* Update tests
2021-03-17 18:22:21 -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
420aa027b3
Exclude base-line from bar size (#8648)
* Exclude base-line from bar size

* lint

* add to types
2021-03-16 08:49:19 -04:00
Jukka Kurkela
0a579b6813
Add alignToPixles option for scales (#8649) 2021-03-16 08:41:51 -04:00
Jukka Kurkela
a6b3b99675
Fix tooltip positioning issues (#8646)
* Fix tooltip positioning issues

* Update fixture, add npm run dev:ff

* Refactor determineXAlign

* Simplify more

* remove unneeded change
2021-03-16 08:06:05 -04:00
Evert Timberg
1f6d0a244b
Linear Scale: Ability to specify a fixed number of ticks (#8643)
* Option to specify exact number of ticks on linear scale
* Fix issue description in tests
* Add tests for conditions where min/max do not align with niceMin/niceMax
* Refactor linear tick generation algorithm
* Add TS definitions
* Update docs
* Code review feedback + lint fixes
2021-03-15 08:49:25 -04:00
Jukka Kurkela
85123ac074
Add option to turn off grouping of bar datasets (#8641)
* Add option to turn off grouping of bar datasets

* Disregard time offset
2021-03-14 11:27:57 -04:00
Jukka Kurkela
f744c3bde6
Add x/y shorthand for padding options (#8637) 2021-03-14 11:21:30 -04:00
Jukka Kurkela
51b2345b67
Loosen the max-statements lint rule for tests (#8638) 2021-03-14 11:07:39 -04:00
Evert Timberg
d84db2cefc
Radial scale point label backdrop color (#8633)
* Radial scale point label backdrop color

* Update default tests

* backdropPadding is a single setting

* Up the tolerance a bit

* Update tick backdrop padding options
2021-03-13 17:37:43 -05:00
Evert Timberg
96f6b42c57
Use font lineHeight for tooltip alignment (#8631)
* Use font lineHeight for tooltip alignment
* Remove toFontString usage from tooltip
2021-03-13 15:14:48 -05:00
Jukka Kurkela
2bff4c1640
Resize: width > 0, height = 0. Use aspectRatio 2 (#8632) 2021-03-13 15:11:20 -05:00
Jukka Kurkela
32fd5af904
Radial: min 1/2 of the max radius as chartArea (#8630)
* Radial: min 1/2 of the max radius as chartArea

* Keep fooling TS
2021-03-13 13:47:21 -05:00
Jukka Kurkela
a026b60653
Change default autoSkipPadding to 3 (#8629) 2021-03-13 13:30:19 -05:00
Evert Timberg
6ac89cbb25
Rename scale gridLines options to be clearer (#8628)
* Rename `options.gridLines` to `options.grid`

* Rename `offsetGridLines` to `offset`
2021-03-13 19:49:09 +02:00
Jukka Kurkela
9799dbd5a0
Scale: autoSkip before fit (#8627)
Scale: autoSkip now occurs before fit in the update process
2021-03-13 11:36:12 -05:00
Jukka Kurkela
aee979da54
Types: fix bubble chart options (#8625) 2021-03-13 08:04:59 -05:00
Jukka Kurkela
bedc3f1575
Fix autoSkip (#8619)
* Fix autoSkip
* Add tests
2021-03-11 16:25:16 -05:00
Jukka Kurkela
1e296ccf4c
Clear stacks when data is replaced (#8617) 2021-03-11 16:20:07 -05:00
Jukka Kurkela
a4231486eb
helpers.curve cleanup (#8608)
* helpers.curve cleanup
* Use distanceBetweenPoints
2021-03-10 09:32:54 -05:00
Jukka Kurkela
d48a62a4e9
Add backgroundColor for scales (#8606)
* Add backgroundColor for scales
* Loosen the threshold
2021-03-10 08:18:10 -05:00
Jukka Kurkela
4c3e992657
RadialLinear: add padding option for point labels (#8604)
* RadialLinear: add padding option for point labels

* lint

* only resolve padding once
2021-03-10 08:40:22 +02:00
Jukka Kurkela
f7ebedc367
Scale: refactor drawTitle, add tests (#8598)
* Scale: refactor drawTitle, add tests
* CC, lint
* update
2021-03-09 08:35:43 -05:00
Jukka Kurkela
b005143470
scale.category: options.min/max can be index (#8594) 2021-03-09 08:08:36 -05:00
Jukka Kurkela
7ec99c38c1
Move startAngle to scale options (#8593) 2021-03-08 13:36:54 -05:00
Evert Timberg
275fdaf3da
Expose radial scale point label positions (#8588) 2021-03-07 16:58:45 -05:00
Jukka Kurkela
160534f913
Add 'single' mode for stacking (#8586)
* Add `'single'` mode for stacking

* Update fixture
2021-03-07 10:52:31 -05:00
Jukka Kurkela
7ccf9e2d4d
Add grace option for linear scale (#8581)
* Add `grace` option for linear scale

* cc
2021-03-06 17:18:49 -05: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
Evert Timberg
279b6ae1da
Enable multi-line axis titles (#8579) 2021-03-06 10:18:32 -05:00
Evert Timberg
a23f1de6df
Rename scaleLabel to title in scale options (#8576) 2021-03-05 23:22:55 -05:00
Jukka Kurkela
bc8385e6bb
Fix layout refit logic (#8567)
* Fix layout refit logic

* CC

* Update fixture
2021-03-04 19:48:26 -05:00
Jukka Kurkela
24b14193b3
Linear: Skip ticks that would overlap with min/max (#8569) 2021-03-04 19:37:46 -05:00
Evert Timberg
91628c1449
Tooltip specific scriptable context (#8561)
* Update plugin to use it's own tooltip context

* Scriptable tooltip option types

* Tests

* Update types to use UnionToIntersection

* Update TooltipItem to use UnionToIntersection
2021-03-04 08:25:24 -05:00
Jukka Kurkela
08b76b0efd
Time: limit offset to sane values, gen >= 2 ticks (#8560) 2021-03-02 17:00:03 -05:00
Jukka Kurkela
118cff7cfc
Remove distribution option from fixtures (#8559) 2021-03-02 16:03:08 -05:00
Jukka Kurkela
78d3d30d56
Add _allKeys descriptor for Object.keys behavior (#8553) 2021-03-01 16:44:14 -05:00
Ben McCann
cc8e513d0f
Add test for normalized option (#8552) 2021-03-01 15:27:36 -05:00
Ben McCann
3214005322
Fix normalize when null values at edge of dataset (#8547)
* Fix normalize when null values at edge of dataset

* Fix test with mismatched number of points
2021-03-01 15:06:48 -05:00
Jukka Kurkela
ae95a8221d
Fix function support on _fallback (#8545) 2021-03-01 12:19:55 -05:00
Jukka Kurkela
86b1892810
Resolve to false only when _fallback is used (#8542)
* Resolve to false only when _fallback is used
* Typo
* 2nd part
2021-02-28 17:32:56 -05:00
Jukka Kurkela
b795151554
Remove the constantly failing test (#8538) 2021-02-28 08:49:34 -05:00
Evert Timberg
c040b8255e
Options need to include dataset level defaults from main chart type (#8534) 2021-02-28 08:58:07 +02:00
Jukka Kurkela
061e3dbf2f
Fix calling of onResize (#8529)
* Fix calling of onResize

* Try to fix the bugging animation test

* try again

* and the actual fix

* maybe now
2021-02-26 14:55:43 -05:00
Ben McCann
7c75310a0c
Use null for skipped values instead of NaN (#8510)
* Use null for skipped values instead of NaN

* Document skipped values when parsing is false

* Update src/core/core.datasetController.js

Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>

* Update src/core/core.datasetController.js

Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>

* fix lint issue

* use isFinite

* revert change checking for pixel values

* ternary readability

* revert accidental paren movement

* test with parsing: false

Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
2021-02-24 18:20:11 -05:00
Jukka Kurkela
8796a1ba1d
Fix stacking bug when a dataset is removed (#8520) 2021-02-24 17:31:17 -05:00
Jukka Kurkela
b06cd36697
Rename cutoutPercentage to cutout + chores (#8514) 2021-02-24 16:58:01 -05:00
Jukka Kurkela
5ab5552acb
Fix layout bug when there are no visible boxes (#8507) 2021-02-24 16:27:11 -05:00
Jukka Kurkela
65a601476c
Remove debug option from animation (#8512)
* Remove debug option from animation

* Add converage for visible animation

* Update visible animation fn
2021-02-24 21:32:54 +02:00
Jukka Kurkela
4207645a9a
Time scale: skip invalid data (#8508) 2021-02-23 15:31:43 -05:00
Jukka Kurkela
639c34f89e
Fix set/delete oprations on Proxies (#8506) 2021-02-23 19:46:31 +02:00
Jukka Kurkela
4c960fb138
Plugin options default scriptable/indexable=false (#8497)
* Plugin options default scriptable/indexable=false

* Update test

* Inherti desciptors

* Remove unreachable code

* remove unintentional change

* remove double default
2021-02-23 17:54:42 +02:00
Evert Timberg
8c4e862a2c
Merge tooltip padding settings (#8493) 2021-02-22 08:30:25 +02:00
Jukka Kurkela
65bfacd9a5
Add outerRadius option to doughnut/pie (#8487) 2021-02-21 17:30:37 -05:00
Jukka Kurkela
6f0e7959df
Only consider visible vertical boxes in layout (#8483) 2021-02-21 15:43:31 -05:00
Jukka Kurkela
5285735c0f
Fix ticks.mirror (#8482) 2021-02-21 14:27:14 -05:00
Jukka Kurkela
5d5e48d01b
Isolate properties / modes from animation options (#8332)
* Isolate properties / modes from animation options
* tabs, something wrong with the linter
* Update misleading variable name
2021-02-20 09:02:22 -05:00
Jacco van den Berg
d264672381
Fix/getRelativePosition NaN value with native event (#8459)
* fix bug where onClick value returned NaN because originalEvent does not exist
* add test for this behaviour
* test to async
2021-02-19 17:57:59 -05:00
Jukka Kurkela
aa5e0fe413
Remove core plugin fallbacks to root options (#8462)
* Remove core plugin fallbacks to root options
* Legend font color default fallbacks
2021-02-19 17:53:01 -05:00
Jukka Kurkela
ce0f7ff903
Update polar animation tests to less error prone (#8461) 2021-02-19 11:44:37 -05:00
Jukka Kurkela
850e6e4588
Update resolver fallback logic (#8456) 2021-02-19 08:30:39 +02:00
Jukka Kurkela
e8f954249a
Update doughnut animation fixture (#8457) 2021-02-18 18:04:48 -05:00
Evert Timberg
e6742e31ac
Add tests for polarArea chart animations (#8455)
* Add tests for polarArea chart animations
* Remove commented code
2021-02-18 17:29:15 -05:00
Jukka Kurkela
e2a47342ba
Add fixture for bar hide/show animation (#8453)
* Add fixture for bar hide/show animation

* Cleanup

* try using longer times
2021-02-18 19:23:15 +02:00
Jukka Kurkela
5411be10a0
Add support for common object methods to Proxies (#8452) 2021-02-18 10:04:46 -05:00
Jukka Kurkela
b468bffa9b
Add test for default doughnut animations (#8446) 2021-02-17 15:42:38 -05:00
Jukka Kurkela
cfd9c98575
Option resolution with proxies (#8374)
* Option resolution with proxies

* Remove plugin fallback to root options/defaults

* Update core plugins, reduntant font fallbacks

* Add some notes
2021-02-15 14:42:32 -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
ffe4ab14dc
Remove options.scale, in favor of options.scales.r (#8393)
Remove options.scale, in favor of options.scales.r
2021-02-06 16:19:21 -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
Ben McCann
eb7ce4e5a0
Add raw data to context and rename dataPoint to parsed (#8318)
* Make the raw data point available in scriptable context
* Rename variables
* Update samples
2021-02-05 09:13:32 -05:00
LeeLenaleee
ae0c8dd457
align text inside chart for far-aligned labels passing test (#8359)
* align text inside chart for far-aligned labels

* added fix for failing test on suggestion of @kurkle

Co-authored-by: Marcel Samyn <marcel.samyn@lab900.com>
2021-01-31 15:19:40 -05:00
Jukka Kurkela
ad84d285d8
Rename LayoutItem.fullWidth to fullSize (#8358) 2021-01-31 13:44:44 -05:00
LeeLenaleee
b50fba3759
Fix/scatter tooltip mode (#8354)
* scatter tooltip should be point by default
* edited mode on better level and updated docs to be bit more clear
2021-01-30 16:22:01 -05:00
LeeLenaleee
bc312d0dbc
feature: choose custom point style for bar legend display (#8341)
* add feature to choose custom point style for bar legend display
* add documentation and type
* the docs are in the right place now
2021-01-30 11:02:08 -05:00
Evert Timberg
06fa8a4c98
Update to test utils 0.1.2 to track font setting (#8325) 2021-01-18 07:40:18 -05:00
Ben McCann
00dbe71dbb
Revert "Update spelling of cancellable (#8236)" (#8312)
This reverts commit e6dfc47927.
2021-01-16 21:14:15 +02:00
Jukka Kurkela
ea34e8b814
Disable Path2D caching when chart is animated (#8319)
* Disable Path2D caching when chart is animated
* Add note to performance docs
2021-01-16 14:06:27 -05:00
LeeLenaleee
aa9a04a014
Skip delete undefined stack (#8291)
* fixes error on undefined stacks
* added test for functionality
2021-01-09 10:27:18 -05:00
Jukka Kurkela
df11fd98cc
Fix incorrect defaults location for Bubble (#8271) 2021-01-05 07:57:09 -05:00
Jukka Kurkela
610461d714
Use provided options in tooltip plugin (#8254) 2020-12-31 08:46:23 +02:00
Jukka Kurkela
2e43f787de
Fix small bugs when animations are disabled (#8253)
* Fix small bugs when animations are disabled
* Update test
2020-12-30 08:31:30 -05:00
Jukka Kurkela
66c92548e8
Rename helpers.clear to helpers.clearCanvas (#8238)
* Change parameters of helpers.clear

* Update test
2020-12-28 10:21:46 +02:00
Ben McCann
e6dfc47927
Update spelling of cancellable (#8236) 2020-12-28 10:20:55 +02:00
Jukka Kurkela
af06586590
Migrate to chartjs-test-utils (#8237) 2020-12-27 14:29:42 -05:00
Evert Timberg
988b3c5d2b
Create standardized text render method (#8227)
* Create standardized text render method
* Document renderText options and enable configurable decoration width
* Add tests for font rendering
* Split color definition to it's own file
* renderText supports setting styles
* Mock context needs to track textBaseline
* renderText can set textAlign and textBaseline
* renderText does not mutate the context + translate/rotate
* Explicitly set the text decoration style
* Move useStroke logic into renderText
* Cartesian scale: Update computeLabelItems to avoid duplicate allocations
2020-12-26 11:23:02 -05:00
Evert Timberg
da0535e1ff
Horizontal axis with center position should display labels (#8221)
* Horizontal axes with center positions should have labels
* Linting
* Test updates
* Increase the tolerance for one test
2020-12-22 11:33:53 -05:00
Evert Timberg
55a26e69ba
Add options to configure tick styling independent of grid lines (#8215)
* Enable axis tick styling independent of grid lines
* Change tickMarkLength to tickLength for consistency with new options
* Add new scale options to TS definitions
2020-12-22 11:27:57 -05:00
Jukka Kurkela
7a2acebc28
Layout: enforce box limits, reject <0 chartArea (#8193)
* Skip chartArea boxes when chartArea <= 0
* Legend: limit to maxWidth/maxHeight
* Layout: enforce box limits, reject <0 chartArea
* Update legend fixtures
2020-12-18 12:56:04 -05:00
Jukka Kurkela
b55b361f97
Reject pending promises when animation is updated (#8184)
* Reject pending promises when animation is updated
* Add tests
2020-12-17 15:16:55 -05:00
Jukka Kurkela
979cd4131b
Fix legend alignment issues (#8168) 2020-12-15 08:50:13 +02:00
Jukka Kurkela
e78310c0fd
ArcElement: Skip draw when radius is negative (#8170) 2020-12-14 17:13:03 -05:00
Jukka Kurkela
8ab62f57be
Use correct color for legend labels (#8167)
* Legend colors fallback
* Update test
2020-12-14 16:08:40 -05:00
Evert Timberg
e268845c7b
Quick exit the legend fit function when the legend is not displayed (#8161)
When the legend is not displayed, there are no guarantees that the
format of the options dictionary is correct. Rather than performing
computations and then exiting without using the results, we can instead
exit quickly since the size of the legend will be (0, 0) if not displayed
2020-12-14 12:04:10 +02:00
Evert Timberg
93c3467182
Prevent double plugin registers from losing the list of plugins (#8162)
When `Chart.register()` was called twice in a row, the list of
plugin descriptors on the chart instance would be cleared. The
next chart update would then restart all of the plugins, not
knowing that they were already started. In the case of the Legend
and Title, this causes two boxes to appear in the layout system
thus drawing twice.
2020-12-14 12:03:08 +02:00
Jukka Kurkela
c1aeba1e67
Add new scale hooks for plugins (#8112)
* Add new scale hooks for plugins

* Add notes

* cc

* cancelability
2020-12-02 06:51:47 +02:00
Jukka Kurkela
6814b79b65
Fix CategoryScale.getValueForPixel with autoSkip (#8101) 2020-12-02 06:51:33 +02:00
Jukka Kurkela
78dbeea1f0
Add new hooks for plugins (#8103)
* Notify beforeUpdate on disabled plugins

cc?

cc2

cc3

typo

* init, unInit, enabled, disabled

self review :)

update the new hook signatures to unified

merge error

* Review update

* start/stop, cc

* types, jsdoc

* stop between destroy and uninstall
2020-11-28 22:57:45 +02:00