]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
allow for multiline labels in tick callback (#9937)
authorJacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com>
Sun, 5 Dec 2021 13:57:44 +0000 (14:57 +0100)
committerGitHub <noreply@github.com>
Sun, 5 Dec 2021 13:57:44 +0000 (08:57 -0500)
types/index.esm.d.ts

index 22d6a53a059209d22869e97e19969fcbb322e93a..cb02b1c91aab197dd1ec853c056bc9aeef466f7e 100644 (file)
@@ -2851,7 +2851,7 @@ export interface TickOptions {
   /**
    * Returns the string representation of the tick value as it should be displayed on the chart. See callback.
    */
-  callback: (this: Scale, tickValue: number | string, index: number, ticks: Tick[]) => string | number | null | undefined;
+  callback: (this: Scale, tickValue: number | string, index: number, ticks: Tick[]) => string | string[] | number | number[] | null | undefined;
   /**
    * If true, show tick labels.
    * @default true
@@ -3302,7 +3302,7 @@ export type RadialLinearScaleOptions = CoreScaleOptions & {
     /**
      * Callback function to transform data labels to point labels. The default implementation simply returns the current string.
      */
-    callback: (label: string, index: number) => string;
+    callback: (label: string, index: number) => string | string[] | number | number[];
   };
 
   /**