]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update stale documentation for axis titles (#9683)
authorcarsonalh <47074583+carsonalh@users.noreply.github.com>
Mon, 29 Nov 2021 21:37:34 +0000 (07:37 +1000)
committerGitHub <noreply@github.com>
Mon, 29 Nov 2021 21:37:34 +0000 (23:37 +0200)
* Update stale documentation for axis titles (#9682)

Updated the documentation for the types on axis labels.

In the corresponding `index.esm.d.ts` file, put JSDoc descriptions for
the properties to match the now-updated documentation.

* Clean up axis title labels documentation (#9682)

Inserted extra information in the documentation for the type of the
padding, inserted missing full stops.

In the type file, added JSDoc for undocumented properties.

* Update docs/axes/labelling.md

* Update types/index.esm.d.ts

Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
docs/axes/labelling.md
types/index.esm.d.ts

index 4f0496e3b86d16c843b57246499a639cb6137c61..83c365807686651797f39e9e2549625291da7a9d 100644 (file)
@@ -13,7 +13,7 @@ Namespace: `options.scales[scaleId].title`, it defines options for the scale tit
 | `text` | `string`\|`string[]` | `''` | The text for the title. (i.e. "# of People" or "Response Choices").
 | `color` | [`Color`](../general/colors.md) | `Chart.defaults.color` | Color of label.
 | `font` | `Font` | `Chart.defaults.font` | See [Fonts](../general/fonts.md)
-| `padding` | [`Padding`](../general/padding.md) | `4` | Padding to apply around scale labels. Only `top` and `bottom` are implemented.
+| `padding` | [`Padding`](../general/padding.md) | `4` | Padding to apply around scale labels. Only `top`, `bottom` and `y` are implemented.
 
 ## Creating Custom Tick Formats
 
index cf1570a31051ea5e5f5a3b33e629fb1b5d866d4e..67c251c6d753972d296dbe64c13caae636639ae7 100644 (file)
@@ -2937,15 +2937,26 @@ export interface CartesianScaleOptions extends CoreScaleOptions {
 
   grid: GridLineOptions;
 
+  /** Options for the scale title. */
   title: {
+    /** If true, displays the axis title. */
     display: boolean;
+    /** Alignment of the axis title. */
     align: 'start' | 'center' | 'end';
+    /** The text for the title, e.g. "# of People" or "Response Choices". */
     text: string | string[];
+    /** Color of the axis label. */
     color: Color;
+    /** Information about the axis title font. */
     font: FontSpec;
+    /** Padding to apply around scale labels. */
     padding: number | {
+      /** Padding on the (relative) top side of this axis label. */
       top: number;
+      /** Padding on the (relative) bottom side of this axis label. */
       bottom: number;
+      /** This is a shorthand for defining top/bottom to the same values. */
+      y: number;
     };
   };