From: Evert Timberg Date: Sat, 24 Oct 2020 22:30:44 +0000 (-0400) Subject: Update category scale labels types to include string[][] (#7953) X-Git-Tag: v3.0.0-beta.5~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4fe6078aaf8558f0a5b785366038b6f8f29cdca;p=thirdparty%2FChart.js.git Update category scale labels types to include string[][] (#7953) --- diff --git a/docs/docs/axes/cartesian/category.md b/docs/docs/axes/cartesian/category.md index 2e3c07c2d..1b83a1b8d 100644 --- a/docs/docs/axes/cartesian/category.md +++ b/docs/docs/axes/cartesian/category.md @@ -45,7 +45,7 @@ These options extend the [common configuration for all cartesian axes](index.md# | ---- | ---- | ----------- | `min` | `string`\|`number` | | The minimum item to display. [more...](#min-max-configuration) | `max` | `string`\|`number` | | The maximum item to display. [more...](#min-max-configuration) -| `labels` | `string[]` | - | An array of labels to display. +| `labels` | `string[]|string[][]` | - | An array of labels to display. When an individual label is an array of strings, each item is rendered on a new line. ## Min Max Configuration diff --git a/types/scales/index.d.ts b/types/scales/index.d.ts index 4324b0188..d37d4b6e5 100644 --- a/types/scales/index.d.ts +++ b/types/scales/index.d.ts @@ -183,7 +183,7 @@ export interface ICartesianScaleOptions extends ICoreScaleOptions { export type ICategoryScaleOptions = ICartesianScaleOptions & { min: string | number; max: string | number; - labels: string[]; + labels: string[] | string[][]; }; export interface CategoryScale extends Scale {}