Commit Graph

826 Commits

Author SHA1 Message Date
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
e1f254fc3e
Add Decimation to all available imports list (#8430) 2021-02-15 14:07:17 -05:00
Evert Timberg
b036b7ba92
Provide a method to quickly register all imports in ESM builds (#8425) 2021-02-15 11:21:31 +02:00
Jukka Kurkela
6de5b3fa9e
Small chores (#8408) 2021-02-10 18:06:48 +02:00
stockiNail
8fa073a0d3
Fixes wrong and missing options and to bar element and dataset doc (#8404) 2021-02-09 22:43:52 +02:00
LeeLenaleee
c280337c21
Update anchorlinks and offscreen canvas compatibility (#8395) 2021-02-08 20:54:39 +02: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
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
Evert Timberg
650956b2e1
Create a new hook to enable data decimation (#8255)
* Create a new hook to enable data decimation

The `beforeElementUpdate` hook can be used to decimate data. The chart
elements will not be created until after this hook has fired ensuring that
if decimation occurs, only the needed elements will be created.

* Address code review feedback

* Rename hook to beforeElementsUpdate

* Simplify parsing logic

* Add decimation plugin to the core

* Allow a dataset to specify a different data key

* Decimation plugin uses the dataKey feature

* Refactor the decimation plugin to support configurable algorithms

* Lint the plugin changes

* Tests for the dataKey feature

* Convert test files to tabs

* Standardize on tabs in ts files

* Remove the dataKey feature

* Replace dataKey usage in decimation plugin

We define a new descriptor for the `data` key allowing the
plugin to be simpler.

* Disable decimation when indexAxis is Y

* Simplify the decimation width approximation

* Resolve the indexAxis correctly in all cases

* Initial documentation

* Reverse check

* Update TS definitions for new plugin options

* Move defineProperty after bailouts

* Add destroy hook
2021-02-01 16:37:32 -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
8cca4fe5b9
getRelativePosition takes two arguments (#8336) 2021-01-25 22:59:19 +02:00
LeeLenaleee
4f74a92b80
Add documentation for vertical line charts (#8327)
* add documentation for vertical line charts

* remove the indexAxis prop from dataset since it doesnt belong there, fix horizontal bars example and make vertical line example

* 2 bars to line rename

* fix v3-migration guide

* revert deletion of prop from table in bar, added in line. Removed anchor point in link from v3 docs

* put right text in general of line
2021-01-18 16:15:30 +02:00
Jukka Kurkela
3c64bc88e8
Doughnut: complete radians to degrees conversion (#8321) 2021-01-16 16:04:48 -05:00
Ben McCann
a730fc68fa
Fix broken links in tooltip docs (#8316) 2021-01-16 21:12:43 +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
19442701ea
clarification that strikethrough uses same color as the label color (#8289) 2021-01-10 15:17:02 -05:00
stockiNail
397d5bdee4
Remove empty line from the options table (#8274) 2021-01-07 21:48:49 +02:00
LeeLenaleee
93b900efdd
Update doughnut.mdx (#8279)
Updating quotation mark to fix broken link
2021-01-07 07:54:18 -05:00
Jukka Kurkela
df11fd98cc
Fix incorrect defaults location for Bubble (#8271) 2021-01-05 07:57:09 -05:00
LeeLenaleee
7c6aff6fb3
Update link to latest version of V2 Docs (#8270) 2021-01-04 15:55:55 -05:00
Ben McCann
e596a13542
Upgrade Docusaurus (#8262) 2021-01-02 08:49:11 +02:00
stockiNail
a22288dc2d
Adds backgroundColor and borderColor options to the documentation (#8257) 2020-12-31 10:19:58 -05:00
stockiNail
3ec3d94a61
Change title font default option (#8258) (#8259) 2020-12-31 10:19:24 -05:00
Jukka Kurkela
d00ffdcd76
Tooltip: Render when animations are disabled (#8252) 2020-12-30 08:33:30 -05:00
Ben McCann
794f13ae0a
Mention npm in installation section (#8245) 2020-12-28 18:45:43 +02: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
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