The `numeric` and `logarithmic` tick formatters require that `this` be provided. That happens automatically if they're used directly as a tick callback but not if they're invoked manually. Failing to pass `this` results in runtime errors similar to the following:
```
TypeError: Cannot read properties of undefined (reading 'chart')
```
* adapted filler plugin to make above/below colors work with pivoted line charts
resolved conflicts in src/plugins/plugin.filler/filler.drawing.js
* fixed doFill; added tests
* fix(plugin.filler): respect dataset clipping area when filling line charts
The filling area must respect the dataset's clipping area when clipping is enabled. Before this change, the line would be clipped according to the dataset's area but the fill would overlap other datasets.
Closes#12052
* chore(plugin.filler): use @ts-expect-error instead of @ts-ignore
* Update docs
Grammar and style: "TypeScript", add articles, etc.
Add docs covering the `Array[]` version of data. Please review and let me know if I've made any mistakes.
Fix an apparent mistake in the `parsing: false` description of category axes: I believe it's trying to say that _strings_ would be a mistake.
* Reword based on feedback and further testing
Otherwise, trying to inherit from DatasetController in a TypeScript project may result in TypeScript errors similar to the following:
> error TS9006: Declaration emit for this file requires using private name 'RadialParsedData' from module '"/Users/joshkel/src/app/node_modules/chart.js/dist/types/index"'. An explicit type annotation may unblock declaration emit.
helpers.dom.ts functions referenced the internal `Chart` JavaScript class rather than the published `Chart<TType, TData, TLabel>` TypeScript definition. This causes errors when outside code tries to call helper functions.
The two `Chart` interfaces are incompatible - the `width`, `height`, and `currentDevicePixelRatio` properties are declared as readonly in the TS declaration but are manipulated by helpers.dom.ts functions, and helpers.dom.ts functions need to be invoked both by internal Chart.js code (which uses the JS class) and by outside code (which uses the TS types). To address this, I'm importing the JS version as `PrivateChart`. There may be a better solution.
It's my understanding that the comment about "typedefs are auto-exported" is obsolete now that helpers.dom is a native TS file.
Fixes#11153
Specific changes:
* `formats` is defined as an arbitrary record. In practice, it maps from `TimeUnit` and `'datetime'` to the specific date library's format strings.
* `parse` and `format` were defined as requiring `TimeUnit`, but they actually take date library format strings. (E.g., it's up to the caller to look up format strings via `formats()` or user parameters.)
* `endOf` is never passed `isoWeek` (`isoWeek` isn't a normal `TimeUnit`, it's only used as a special case to `startOf`), and [chartjs-adapter-date-fns](https://github.com/chartjs/chartjs-adapter-date-fns/blob/v3.0.0/src/index.js#L101) doesn't support it.
* The constructor's options parameter is optional.
* `weekday` is documented as allowing a boolean (true means to start on Monday).
* `export default { _date: DateAdapterBase }` meant that `new _date()` returns a `DateAdapterBase` instance, whose methods take no parameters. Since it can be overridden at runtime, I replaced it with a more generic constructor + static methods.
* First step in fixing the bug of spanGaps null point interaction
* Complete bugfix of spanGaps null point interaction
* Add two tests in core.interaction.tests for the bugfix change
* Remove odd line break
* Use isNullOrUndef helper for point value checks
* Add 10 more test cases for nearest interaction when spanGaps=true
* Bugfix: spanGaps not working near min and max limits
* Fix error when meta.dataset.options = null
* Add tests for correct setting of line controller properties _drawStart and _drawCount
* Fix spacing in controller line tests
* Add tension to test
* Add a better test case
* Avoid the use of FindLastIndex
* Avoid taking 0 for null value and improve naming
* exclude 0 angle from inRange to not showing tooltip when all data are hidden
Signed-off-by: Hu, Vince <Qingkun.Hu@fmr.com>
* test 0 angle point not in arc range
---------
Signed-off-by: Hu, Vince <Qingkun.Hu@fmr.com>
When exactOptionalPropertyTypes, TypeScript distinguishes between the
value undefined and the property not existing. See:
https://www.typescriptlang.org/tsconfig/#exactOptionalPropertyTypes
For Chart.js options, this difference is not important and either
passing undefined or not including it have the same effect.