diff --git a/docs/axes/labelling.md b/docs/axes/labelling.md index 527e53fd175..936ca4c485e 100644 --- a/docs/axes/labelling.md +++ b/docs/axes/labelling.md @@ -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 diff --git a/types/index.esm.d.ts b/types/index.esm.d.ts index 548720c57ca..036f079cb63 100644 --- a/types/index.esm.d.ts +++ b/types/index.esm.d.ts @@ -2903,15 +2903,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; }; };