Commit Graph

2101 Commits

Author SHA1 Message Date
Evert Timberg
a8a83d12cd Provide APIs to set active (hovered) and tooltip elements. (#7845)
Provide APIs to set active (hovered) and tooltip elements.

Chart.setActiveElements will set the hovered items.
Chart.tooltip.setActiveElements will set the tooltip items.
2020-10-05 17:14:38 -04:00
Jukka Kurkela
8d36927b29 Normalize context creation for option resolution (#7847)
* Normalize context creation for option resolution
* Pass mode to _computeAngle
2020-10-05 09:03:16 -04:00
Jukka Kurkela
1a9b452cda Limit pixel values further to 16bit integer range (#7848) 2020-10-05 08:37:12 -04:00
Evert Timberg
8438da9e84 Provide method to lookup a chart from a canvas (#7843)
* Provide method to lookup a chart from a canvas
* Throw an error during construction if a canvas is in use
* Migration docs for new constructor behaviour
2020-10-04 11:08:38 -04:00
Evert Timberg
9b204eb278 Enable per-dataset circumference and rotation for pie/doughnut charts (#7833)
* Enable per-dataset circumference and rotation for pie/doughnut charts
* Convert `circumference` and `rotation` options to degrees
2020-10-03 16:47:39 -04:00
Jukka Kurkela
07d50a59bc Clone cached options if enableOptionSharing!=true (#7837)
Clone cached options if enableOptionSharing!=true
2020-10-02 08:15:47 -04:00
Jukka Kurkela
2ac0436bd4 Use full height for fullWidth box when left/right (#7836)
Use full height for fullWidth box when left/right
2020-10-02 08:13:04 -04:00
Evert Timberg
08b69fd974 Allow contextmenu (right click) events to trigger the onClick handler (#7828) 2020-10-01 08:47:09 -04:00
Jukka Kurkela
c4243683fa Make dataset animations obey chart level disable (#7820) 2020-09-28 09:51:28 -04:00
Samuel Gratzl
391e4b6f2e flat helpers (#7806)
* generate a flat helpers package
* move helpers built files to dist
* upgrade docs for flat helpers
2020-09-28 09:11:55 -04:00
Jukka Kurkela
10f393a58d Fix: maximum size and mouse position with styling (#7816)
Fix: maximum size and mouse position with styling
2020-09-26 13:18:35 -04:00
Jukka Kurkela
7633343c2f Fix: Update/draw only visible -regression (#7808) 2020-09-20 16:46:55 -04:00
Jukka Kurkela
8cdc60ccd1 [perf] Update/draw only visible line/points (#7793)
* Restore count parameter to updateElements
* [perf] Update/draw only visible line/points
* CC
2020-09-15 18:57:31 -04:00
Jukka Kurkela
17e27e16cc Limit pixel values to 32bit integer range (#7800) 2020-09-15 15:33:59 -04:00
Jukka Kurkela
2c5db2c350 Fix some CC issues (#7796)
* Fix some CC issues
* Merge _lookup, _lookupByKey, _rlookupByKey
* Remove TODO from types
* Merge TRBL logics
* Merge getMaximumWidth and getMaximumHeight
2020-09-14 14:40:19 -04:00
Jukka Kurkela
2f888172d4 Cache event offset coordinates (#7795) 2020-09-14 11:37:29 -04:00
Jukka Kurkela
2563ff174e Merge x/y interaction mode functions (#7794) 2020-09-14 11:36:35 -04:00
LAU
c20360d08a Better error message when importing charts incorrectly. (#7790)
* Created a better error message when chartjs can't find an element in the DOM.
Also, prevented an exception when trying to find the canvas assuming is an array. When it could also be null.

* Exception is not thrown anymore in getCanvas. Now this pr only prevents the
item.lenght exception and logs a better error when a chart cant be created.

* Deleted error description because i forgot chartjs is used in varois other ways than importing, also used isArray from helpers.core

* isArray check deleted because the type of the dom element received in getCanvas could be not only an array.

Co-authored-by: Lautaro Alonso Urtiaga <lautaro.urtiaga@10pines.com>
2020-09-14 09:57:50 -04:00
Jukka Kurkela
1cc8d50bc9 Fix: relative position in FF (#7792)
* Fix: relative position in FF
* Add tests
2020-09-13 17:20:14 -04:00
Jukka Kurkela
9427398b3c Fix hover-out regression (#7785) 2020-09-11 10:46:25 -04:00
stockiNail
fd34e786ab isoWeekday time options on time scale as number (#7768)
* fixed default of tension property of line element
* Fixes isoWeekday on time scale #7749
* adds checking on isoWeekDay options in _generate function
2020-09-07 16:19:45 -04:00
Jukka Kurkela
cb8aae9b98 Cache Intl.NumberFormat instances (#7755)
* Update dependencies
* Cache Intl.NumberFormat instances
2020-09-04 16:49:38 -04:00
Jukka Kurkela
d5eaa12d96 Fix: update chart when attached (#7758) 2020-09-04 16:47:36 -04:00
Jukka Kurkela
c749fbdf5f Fix the parameter order of before/afterEvent (#7757) 2020-09-04 16:47:08 -04:00
Jukka Kurkela
4fa2c408f0 Remove duplicate code, clearer parameter names (#7756) 2020-09-04 16:46:44 -04:00
Jukka Kurkela
effe988bbf Reduce code duplication and sort generated ticks (#7747)
* Reduce code duplication and sort generated ticks
* Add test
2020-09-02 08:09:39 -04:00
Jukka Kurkela
da33b1bb27 Fix shared option handling (#7731)
Fix shared option handling
2020-08-27 09:14:08 -04:00
Jukka Kurkela
baa4429ad1 Use offsetX/Y or layerX/Y for events when available (#7732)
* Use offsetX/offsetY for events when available
* Fall to layerX/layerY for FF compatibility
2020-08-25 08:04:06 -04:00
Jukka Kurkela
d561486b4e Revert "Preserve object prototypes when cloning (#7381)" (#7727)
This reverts commit 51be344717.
2020-08-24 08:15:56 -04:00
Jukka Kurkela
ae214d9fbd Resize on devicePixelRatio changes (#7717)
* Resize on devicePixelRatio changes
2020-08-19 07:08:41 -04:00
Jukka Kurkela
f5b4a0fa3c Improve test coverage and fix minor issues found (#7713)
* Registry
* Element
* Animation
* Animations
* Animator
2020-08-17 10:03:15 -04:00
Jukka Kurkela
dd261b22f9 Use interpolation in fill: 'stack' (and fix interpolation) (#7711)
* Add tests and fix _boundSegment
* Use interpolate for finding points below
* Remove _refPoints logic (getTarget in draw)
2020-08-16 11:18:46 -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
6ad17c0294 Stop bundling specs for improved coverage (#7709) 2020-08-14 09:15:18 -04:00
Evert Timberg
8fd7ef2901 Doughnut controller overrides (#7702) 2020-08-11 17:11:57 -04:00
Jukka Kurkela
6f83c55be5 'stack' mode for filler (#7705)
'stack' mode for filler
2020-08-11 09:31:18 -04:00
Jukka Kurkela
f79d609548 Add offset option for arc (#7691)
* Add offset option for arc
* Finishing touches
2020-08-05 07:35:28 -04:00
Jukka Kurkela
9c27f74801 Export extensible classes in ESM compatible way (#7650)
* Export extensible classes in ESM compatible way
* Export collection helperrs
* Remove reduntant registry assignment
2020-08-03 12:33:41 -04:00
Jukka Kurkela
2ea01d9beb Include Chart.defaults always (#7686) 2020-08-03 12:33:21 -04:00
Jukka Kurkela
e756fb93a3 Resolve fonts through options.font (#7674)
* Resolve fonts through options.font
* Remove defaultRoutes from Tooltip fonts
2020-08-03 12:32:58 -04:00
Evert Timberg
70c2b07eb2 Do not use line defaults in legend (#7649) 2020-07-19 12:52:59 -04:00
Jukka Kurkela
7f4b74d956 minBarLength at base going both ways (#7642) 2020-07-17 13:29:43 -04:00
Jukka Kurkela
bc27b522c0 FloatBar: update range only for value scale (#7634) 2020-07-16 13:31:11 -04:00
Jukka Kurkela
dc5f88b620 Animation events sanity (#7629) 2020-07-16 13:30:07 -04:00
Jukka Kurkela
af855d7646 Fix remaining issues in samples (#7625)
* Fix remaining issues in samples
* Update migration guide
* Use element instead
* Update tooltip.md
2020-07-16 13:28:12 -04:00
Jukka Kurkela
d3eaf2ff2a Leftover defaults (#7628)
* Remove leftover placeholders from defaults
* Add migration note about moved plugin defaults
2020-07-15 18:13:10 -04:00
Jukka Kurkela
c51af9f13e Fix category scale tick placement with autoSkip (#7622) 2020-07-15 18:12:32 -04:00
Jukka Kurkela
572b1c737e Move register/unregister to core.controller (#7626) 2020-07-15 18:11:56 -04:00
Ben McCann
426d8debba Tooltip: add dataPoint and rename value to formattedValue (#7618)
* Tooltip: add dataPoint and rename value to formattedValue
* Add a test
2020-07-14 17:40:32 -04:00
Jukka Kurkela
6deafdb4d4 Registry fixes (#7617)
* Fix documentation for classical extensions
* Tests and fixes for registry
2020-07-13 17:43:30 -04:00