]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update category scale labels types to include string[][] (#7953)
authorEvert Timberg <evert.timberg+github@gmail.com>
Sat, 24 Oct 2020 22:30:44 +0000 (18:30 -0400)
committerGitHub <noreply@github.com>
Sat, 24 Oct 2020 22:30:44 +0000 (18:30 -0400)
docs/docs/axes/cartesian/category.md
types/scales/index.d.ts

index 2e3c07c2dc337d035acfdc9136a17cd4834e7572..1b83a1b8d0fce29cd745a3fa341b4ecc59415aa5 100644 (file)
@@ -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
 
index 4324b0188df043ca276499b273c14c8db10f3e61..d37d4b6e5eeebf19c0440ff819cc92de604ad6a4 100644 (file)
@@ -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<O extends ICategoryScaleOptions = ICategoryScaleOptions> extends Scale<O> {}