Commit Graph

798 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Salman Kazmi
5e22f56865
added comma to fix syntax issue (#8177) 2020-12-16 10:35:54 -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
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
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
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
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
lab900-marcel-samyn
e08b17636b
[v3] Add locale to ChartOptions type (#8118)
* Add locale to ChartOptions type

* Adds locale options documentation

* fixed typo

* changes links to number format, linking the constructor

* changes to a better sentence

* changes to better sentence (2)

Co-authored-by: stock <stocki.nail@gmail.com>
2020-12-04 08:25:43 +02:00
LeeLenaleee
c3fbe5efc3
Fix/area fill and chart titles (#8113)
* fixed fill for area chart stacked and title for charts where it wasn't in plugins yet
* Chart defined in utils
* added radar skip points example in the overview to go to
2020-11-30 09:59:20 -05:00
Wenfang
8220caaa43
Update performance.md (#8107)
fixed typo
2020-11-28 16:57:17 -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
d6b4fe2629
LineElement: no fill by default (#8111)
* LineElement: no fill by default
* Update negative-times fixture
2020-11-28 15:07:46 -05: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
e3ad31893d
Restore datasets namespace (revert 6955) (#8090) 2020-11-24 22:27:51 +02:00
Jukka Kurkela
021561072b
Disable all plugins when options.plugins = false (#8098)
Disabling all plugins when options.plugins = false
2020-11-23 17:58:03 -05:00
LeeLenaleee
5f099f3822
coppied to wrong place in file, backgroundColor should be in the data… (#8081)
* coppied to wrong place in file, backgroundColor should be in the dataset and not after the datasets array
* fixed indenting and color to be more in line with bublle and pie color
2020-11-19 15:33:59 -05: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
LeeLenaleee
6928b23a50
made scatter chart a lot better readable, removed unnecesarry notes (#8080) 2020-11-19 08:25:39 -05:00
Jukka Kurkela
fb1f90ca0e
Remove classic style extensions from docs/tests (#8076) 2020-11-19 07:55:20 -05:00
SaintMalik
065fc117af
Fix url bug (#8072) 2020-11-19 07:54:49 -05:00
SaintMalik
200c04db99
fix broken url in docs (#8070) 2020-11-18 07:57:59 -05:00
LeeLenaleee
046d37882a
v2 note not nessecary in v3 docs and update example (#8071)
* v2 note not nessecary in v3 docs
* adjusted example

Co-authored-by: Jacco van den Berg <jacco@uniware.nl>
2020-11-18 07:55:41 -05:00
Jukka Kurkela
39923eb167
Add missing import to styling.mdx (#8065) 2020-11-17 08:03:37 -05:00
Jukka Kurkela
ed846f62f7
Update axis documentation (#8061) 2020-11-16 15:05:29 -05: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
LeeLenaleee
29f887b38c
Update v3-migration.md (#8047)
Treeshaking import names for the elements were not updated in the docs when they got changed
2020-11-13 07:03:21 -05:00
Laurent Pellegrino
d063f654cf
Fix import names in integration example (#8039) 2020-11-11 18:34:38 -05:00
LeeLenaleee
effe31166b
documenattion error (#8037)
Co-authored-by: Jacco van den Berg <jacco@uniware.nl>
2020-11-11 11:05:46 -05:00
Jukka Kurkela
d74a5d7552
Add type to context objects (#8007) 2020-11-08 08:43:55 -05: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
xr0master
afbe03cce4
[types][beta-5] fixed stacked scale, changed default type for data.labels (#8001)
* Scale: added the stacked property for all scales
* interfaces: generic type LABEL can be string, Date, etc.
* controllers: stack can be used for all types of dataset
* docs/data-structures: added general dataset properties

Co-authored-by: Sergey Khomushin <sergey@placer.io>
2020-11-05 09:12:25 -05:00
Jukka Kurkela
e277aa4c1f
Destroy example charts on unmount (#8004)
* Destroy example charts on unmount
* Make scatter live
* Use spaces
2020-11-04 14:58:53 -05:00
Jukka Kurkela
4daf37e864
Delay resize to just before draw when animating (#7989)
* Remove unused properties
* Delay resize to just before draw when animating
* Remove silent resize, update migration guide
* Fix typo in migrations doc

Co-authored-by: Evert Timberg <evert.timberg+github@gmail.com>
2020-11-01 08:15:43 -05:00
Jukka Kurkela
23bf7c0c89
Preserve scriptable context (#7981)
* Preserve scriptable context
* CC, utilize `index` in tests
* Update example to utilize context
2020-11-01 07:39:08 -05:00
Takuya Uehara
23de72c7e3
Use TypeScript syntax highlight for TypeScript code (#7988) 2020-11-01 07:28:45 -05: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
Dan Manastireanu
6869a41d40
feat: Draw tooltips with point styles. Closes #7774 (#7972)
* feat: Draw tooltips with point styles. Closes #7774

* chore: Add tooltip usePointStyle docs

* chore: Add tests and visual tests for tooltip usePointStyle

* chore: Update typescript with tooltip usePointStyle
2020-10-29 22:55:40 +02:00