stockiNail
57bbd8229d
Fix mismatch between hit boxes and drawn items in legend plugin ( #11352 )
...
* Fix mismatch between hit boxes and drawn items in legend plugin
* fixes padding calculation
2023-06-20 18:20:12 +02:00
Dan Onoshko
64a027874c
fix: move types to src dir to escape src / dist dirs in paths ( #10993 )
2022-12-16 07:56:06 -05:00
Dan Onoshko
51441272a7
refactor: move to esm in sources ( #10879 )
2022-11-17 08:08:44 -05:00
Kartik
1253ceddb1
FIX: render multiline legend items without overlapping ( #10532 ) ( #10641 )
...
* FIX: render multiline legend items without overlapping (#10532 )
Co-authored-by: Nirav Chavda <nmchavda99@gmail.com>
* CLN: Extract method to fix codeclimate line count
Co-authored-by: Nirav Chavda <nmchavda99@gmail.com>
* CLN: Shift helper methods from class to module scope
Co-authored-by: Nirav Chavda <nmchavda99@gmail.com>
* TST: Add test with fixtures
Co-authored-by: kartik <codebull707@gmail.com>
* FIX: Fix test case for multiline label
Co-authored-by: kartik <codebull707@gmail.com>
* 10532-ENH: Calculate legend item width for multiline labels
Co-authored-by: Nirav Chavda <nmchavda99@gmail.com>
* 10532-TST: use spriteText and non-empty labels for test
Co-authored-by: Nirav Chavda <nmchavda99@gmail.com>
* 10532-FIX: failing test case due to legendItem.text being undefined
Co-authored-by: Nirav Chavda <nmchavda99@gmail.com>
* 10532-FIX: Update compression size
Co-authored-by: kartik <codebull707@gmail.com>
Co-authored-by: Nirav Chavda <nmchavda99@gmail.com>
2022-09-16 09:46:53 -04:00
Jacco van den Berg
d09e424a0a
Use borderRadius for legend and remove fallbacks ( #10551 )
...
* Use borderRadius for legend
* re enable test
* fix lint
* add note in migration guide
* Update types/index.d.ts
Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
2022-08-18 07:34:18 -04:00
Dan Onoshko
ce375a6876
feat: add ESM support ( #10525 )
...
* feat: add ESM support
* build: rename UMD bundle
* chore: edit supbackages description
* style: disable es/no-import-meta linter rule
* test: dynamic import in cjs module
* docs: edit integrations page
* docs: review fixes
* chore: remove useless regex in webpack config
* ci: test size-limit only for ESM bundle
2022-08-04 18:43:26 -04:00
Dominic Jean
a31e1e59d6
pass boxWidth only if pointStyleWidth presents ( #10524 )
2022-07-29 16:40:28 +03:00
Dominic Jean
5452502b8c
Add pointStyleWidth option for legend ( #10412 )
...
* add pointStyleWidth for legend
* add drawPointLegend to keep drawPoint signature
2022-07-18 06:49:08 -04:00
Evert Timberg
54dcd6a6d3
Trigger legend onLeave when the mouse leaves the canvas ( #10301 )
2022-04-15 19:36:42 -04:00
Jukka Kurkela
ba6b446b04
Limit active element changes to chartArea ( #9970 )
...
* Limit active element changes to chartArea
* CC, remove duplicate ChartEvent interface
* CC2
2021-12-08 16:44:45 +02:00
Jukka Kurkela
0c5db4973e
Fix inRange for full circle arc ( #9871 )
...
* Update misleading sample comment
* Fix inRange for full circle arc
2021-11-18 00:10:19 +02:00
Evert Timberg
8e68481ec4
Remove const me = this pattern ( #9646 )
2021-09-14 07:37:22 -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
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
87bd5785ff
Legend: fix layout padding handling ( #9290 )
2021-06-19 18:31:33 -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
Evert Timberg
d6d189c804
Legend boxes support borderRadius ( #8875 )
2021-04-10 15:05:34 -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
88c585b11e
Legend: adjust lifecycle and event handling ( #8753 )
2021-03-30 10:12:07 -04:00
Jukka Kurkela
fe406bf717
Legend: Ignore replayed events ( #8749 )
2021-03-28 12:21:53 -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
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
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
ddfbcf777a
Update eslint-config-chartjs to v0.3.0 ( #8406 )
2021-02-10 08:21:39 -05:00
Jukka Kurkela
ad84d285d8
Rename LayoutItem.fullWidth to fullSize ( #8358 )
2021-01-31 13:44:44 -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
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
979cd4131b
Fix legend alignment issues ( #8168 )
2020-12-15 08:50:13 +02:00
Jukka Kurkela
8ab62f57be
Use correct color for legend labels ( #8167 )
...
* Legend colors fallback
* Update test
2020-12-14 16:08:40 -05:00
Jukka Kurkela
e1a3303c67
Legend plugin cleanup ( #8109 )
...
* Legend plugin cleanup
* cc1
* cc2
* cc3
* start/stop
2020-12-14 15:35:04 +02: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
LeeLenaleee
ae04fcf3c3
fix default font color for legend ( #8139 )
...
* fix default font color for legend
* adjusted docs to be consistent with fontColor to color
2020-12-05 14:34:34 -05: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
Jukka Kurkela
61aea761f4
Unify signature of plugin hooks ( #8102 )
2020-11-28 09:45:43 +02: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
ddc72fcfbb
Align font options with CSS ( #8066 )
...
* Align font options with CSS
* Review comments
2020-11-19 20:59:24 +02:00
Jukka Kurkela
910158055f
Drop legacy browser support ( #8009 )
...
* Drop legacy browser support
* Docs
* Use rollup-plugin-istanbul for coverage
* exclude node_modules from coverage
* No cleanup() when doing coverage
2020-11-16 21:01:33 +02:00
Evert Timberg
17f6edb650
Remove I prefix from TS types ( #8017 )
...
* Remove I prefix from TS types
* Update missing `ILayoutItem` typedefs
* IEvent should become ChartEvent
* Prevent FillTarget collision
* Import FontSpec instead of IFontSpec
* Prevent recursive DateAdapter problem
2020-11-07 08:35:19 -05:00
stockiNail
ea047f5cf2
Legend item lineWidth is the average of borderWidth when set as object (Bar) ( #7964 )
...
* fixed default of tension property of line element
* Fix #7942
* Fixes some lint errors
* fixes "Expected property shorthand" error
2020-10-28 13:12:52 +02:00
Evert Timberg
4ed650acbe
Enable overriding the legend pointStyle using new pointStyle option ( #7959 )
2020-10-26 14:16:00 +02:00
Jukka Kurkela
73b4e82fd5
Use Object.create(null) as merge target, to prevent prototype pollution ( #7917 )
...
Use Object.create(null) as merge target to prevent polluting `Object.prototype`
2020-10-18 13:31:01 -04:00
Jukka Kurkela
06b5325778
Add maxWidth/maxHeight options for legend ( #7852 )
2020-10-06 07:41:16 -04:00
Evert Timberg
168965fa38
Enable custom sorting of the legend items ( #7851 )
2020-10-05 22:15:38 -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
b8ad2a6a0a
Registry bugs ( #7608 )
...
* Stop failing early when no scales are registered
* Move filler defaults
* Move legend defaults
* Remove legendHitBoxes from title
* Move @kurkle/color to devDependencies
2020-07-13 09:41:42 -04:00
Evert Timberg
537cd74919
Update the legend object during beforeUpdate ( #7528 )
...
* Update the legend object during beforeUpdate
When the legend is updated in afterUpdate, the position is not updated
before the layout system runs. When the event that the legend position
was changed, the legend would not move to the new position in the layout
system. This causes the chart to render incorrectly because the layout
system handled the layout as if the legend was still at the original position.
The update is split into two passes to ensure that labels still update correctly
after datasets (#6968 )
2020-06-20 07:30:31 -04:00
Evert Timberg
0703d78286
Enable custom legend box heights ( #7459 )
...
Enable custom legend box heights
2020-06-04 19:53:40 -04:00
Evert Timberg
13b8924ac3
Legend onClick callback supports arrow functions ( #7410 )
...
#7409 Legend callbacks support arrow functions
The `Legend` is no longer implicitly found through `this` and instead
passed as an explicit argument to the callback functions.
2020-05-24 10:28:41 -04:00
Jukka Kurkela
5a83a80811
Move font* to font.* ( #7383 )
2020-05-21 17:07:06 -04:00