Commit Graph

3514 Commits

Author SHA1 Message Date
Ben McCann
e6dfc47927
Update spelling of cancellable (#8236) 2020-12-28 10:20:55 +02:00
Evert Timberg
78e78256a5
Cache the lineheight regex (#8240) 2020-12-28 10:19:16 +02:00
Jukka Kurkela
af06586590
Migrate to chartjs-test-utils (#8237) 2020-12-27 14:29:42 -05:00
Evert Timberg
f44db35e2e
Clean up the LayoutItem type (#8235) 2020-12-26 16:22:55 -05:00
Evert Timberg
7415517c83
Cache data limits to ensure they are only computed once per update (#8234)
* Cache data limits to ensure they are only computed once per updaet
* Replace `invalidateCaches` on scales with `beforeLayout`
2020-12-26 14:37:23 -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
LeeLenaleee
287633a436
Example code plugin outdated (#8230)
Update example code.
As stated in the migration guide: `All plugin hooks have unified signature with 3 arguments: chart, args and options.`
2020-12-24 09:40:13 -05:00
Evert Timberg
3ffcd93d10
Enable changing the chart type (#8226) 2020-12-23 13:38:51 -05:00
Evert Timberg
55dd7ded0e
Remove duplicate Scriptable definitions (#8223) 2020-12-22 13:10:25 -05:00
Evert Timberg
1b0ed0c8c5
Scriptable tick colours (#8222) 2020-12-22 12:11:00 -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
LeeLenaleee
074f3b6d2e
Ensure that default collections table is clear (#8216)
addition to #8124
2020-12-22 10:22:25 -05:00
Evert Timberg
491f871218
Add note about loading fonts and chart updates (#8214) 2020-12-21 16:10:13 -05:00
Evert Timberg
009a1a5baa
Ensure that default animation modes table is clear (#8212) 2020-12-21 15:26:13 -05:00
Evert Timberg
ec7b381345
Split animation definitions (#8208) 2020-12-20 13:26:09 -05:00
LeeLenaleee
544f50888e
Docs/multiline labels (#8201)
* Docs/multiline labels

Fixes #8172

* Update data-structures.md

Update with if the labels is used since it can be skipped by providing the datapoints as an object
2020-12-20 11:49:39 -05:00
Evert Timberg
388918924f
Split Element type to it's own definition file (#8206) 2020-12-19 21:56:11 +02:00
Jukka Kurkela
dd382bc806
Split adapter types to their own definition file (#8205)
* Split adapter types to their own definition file
* Sort & separate
2020-12-19 14:03:26 -05:00
Evert Timberg
75fcd4fffa
Split geometric types to their own definition file (#8202)
* Split geometric types to their own definition file
* Re-export types
2020-12-19 13:39:35 -05:00
Jukka Kurkela
1110d4dd19
Update CI (#8204) 2020-12-19 12:52:18 -05:00
Jukka Kurkela
2dcd37f85c
Update dependencies (#8203) 2020-12-19 12:49:06 -05:00
Evert Timberg
a182cbed7b
Merge TS files into a single file to prevent circular loops (#8198) 2020-12-19 10:37:33 -05:00
LeeLenaleee
e529775d5e
Update showLine location in defaults (#8199)
Current defaults was wrong.
Working example: https://jsfiddle.net/Leelenaleee/vL7d6yp0/5/
2020-12-19 09:52:27 +02:00
stockiNail
f16e836c3d
Add color options to documentation and types where missing (#8196)
* fixes #8188 and #8189

* removes scriptable context sample with link to options page

* Removes <code> tags in markdown where not needed
2020-12-18 22:03:01 +02: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
Josh Kelley
efbaf2c082
TypeScript updates (#8190)
* Update type definitions and docs for legends

* Fix types for onHover and onClick callbacks

core.controller.js's implementation also passes the Chart instance as `this`. However, that isn't documented, and it's my impression that Chart.js is moving away from passing items as `this`, so I didn't declare it in the type definitions.

* Allow multi-line ticks

* Stricter DeepPartial definition

The previous definition resolved to `{}` (which can allow primitives) if it was given a function, so it was far too broad for any `Scriptable<>` properties.

* Grammar and writing style

* Updates to animation docs

Document the `fn` option, since it's in the type definitions.

Fix callback usage to match example code.

* Fix AnimationEvent parameter

The onProgress and onComplete events were mistakenly declared as taking the standard DOM AnimationEvent.  (Should Chart.js's AnimationEvent be renamed to ChartAnimationEvent to avoid any possible ambiguity?)

* Allow false for disabling animations

* Add comments explaining the layout and usage of Rollup
2020-12-18 12:46:54 -05:00
Jukka Kurkela
04c45aacda
Make PointLabels color scriptable (#8194) 2020-12-18 12:36:38 -05:00
Jukka Kurkela
b2d5a5fa97
Update defaults and types for tick stroke (#8195) 2020-12-18 12:36:18 -05:00
UrielMaD
92646a973d
Radius validation for drawRadiusLine (#8191) 2020-12-18 12:35:13 -05:00
Evert Timberg
b54bd272fb
Move tooltip plugin hooks to the core Plugin type (#8160)
* Move tooltip plugin hooks to the core
* Try and use declaration merging for Plugin type
* Merge Plugin types
2020-12-17 18:10:29 -05:00
Jukka Kurkela
b10d994017
Hover: only update styles of changed elements (#8185) 2020-12-17 15:18:02 -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
David Turbert
3c79d104d9
Add ArcElement to getting-started.md (#8174)
* fix: add ArcElement to getting-started.md
* fix: add all possible imports
* fix: add text to integration.md
2020-12-16 16:41:19 -05:00
LeeLenaleee
f191f2f5f9
Remove dataset while hovered (#8181) 2020-12-16 16:40:10 -05:00
Salman Kazmi
5e22f56865
added comma to fix syntax issue (#8177) 2020-12-16 10:35:54 -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
Jukka Kurkela
e1a3303c67
Legend plugin cleanup (#8109)
* Legend plugin cleanup

* cc1

* cc2

* cc3

* start/stop
2020-12-14 15:35:04 +02:00
Josh Kelley
5ed422a93a
Update docs for .resize() method (#8151)
See #7678 and #8149.  (The `silent` parameter mentioned in the original 7678 no longer exists.)

Add JSDoc.

Fix some minor issues with grammar and coding style consistency.
2020-12-14 12:30:20 +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
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
LeeLenaleee
e3953acf1e
default values for element background and border color were wrong (#8156) 2020-12-11 10:52:54 -05:00
Josh Kelley
dc00ed08cb
Update docs on printing (#8149)
From what I can tell from testing locally, Chrome doesn't reliably trigger resize events for the final print layout, so using `.resize()` with no parameters doesn't generally work.

I'm not sure if there are circumstances in which the original docs' suggestion of using `.resize()` with no parameters can work; if the original text should be deleted, I can do so.

I also noticed that the TypeScript type definitions for `.resize()` mark the parameters as required, even though the implementation and docs don't require them.
2020-12-10 16:25:00 +02:00
Evert Timberg
649f815328
Respect the set locale for in the pie/doughnut tooltips (#8142) 2020-12-06 18:17:22 -05: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
9b7eb5095a
CI: Conditionally run steps based on changes (#8132)
* CI: Run the `Package` step only when docs change

* Advanced conditionals

* Conditional coveralls

* Fix bunch of typos

* remove coveralls finished condition

* Revert "remove coveralls finished condition"

* Add curlys
2020-12-05 17:57:19 +02:00
LeeLenaleee
8192b2fd56
Clarification: barPercentage vs categoryPercentage (#8138)
Clarification of the docs to make it little less confusing after seeing the .1 hopefully.
Comes from #8137
2020-12-05 17:55:19 +02:00
dependabot[bot]
a7ff116547
Bump highlight.js from 10.3.1 to 10.4.1 (#8128)
Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 10.3.1 to 10.4.1.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/master/CHANGES.md)
- [Commits](https://github.com/highlightjs/highlight.js/compare/10.3.1...10.4.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-04 21:45:56 +02:00