Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update stale documentation for axis titles #9683

Merged
merged 4 commits into from Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/axes/labelling.md
Expand Up @@ -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

Expand Down
11 changes: 11 additions & 0 deletions types/index.esm.d.ts
Expand Up @@ -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;
kurkle marked this conversation as resolved.
Show resolved Hide resolved
/** This is a shorthand for defining top/bottom to the same values. */
y: number;
};
};

Expand Down