Skip to content

Commit 454c6a6

Browse files
committed
docs(plugin.legend): add documentation for legend navigation
1 parent 3c4a72c commit 454c6a6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/configuration/legend.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The doughnut, pie, and polar area charts override the legend defaults. To change
2626
| `rtl` | `boolean` | | `true` for rendering the legends from right to left.
2727
| `textDirection` | `string` | canvas' default | This will force the text direction `'rtl'` or `'ltr'` on the canvas for rendering the legend, regardless of the css specified on the canvas
2828
| `title` | `object` | | See the [Legend Title Configuration](#legend-title-configuration) section below.
29+
| `navigation` | `object` | | Handle large sets of legends with pagination. [more...](#legend-navigation-configuration)
2930

3031
:::tip Note
3132
If you need more visual customizations, please use an [HTML legend](../samples/legend/html.md).
@@ -86,6 +87,24 @@ Namespace: `options.plugins.legend.title`
8687
| `padding` | [`Padding`](../general/padding.md) | `0` | Padding around the title.
8788
| `text` | `string` | | The string title.
8889

90+
## Legend Navigation Configuration
91+
92+
Namespace: `options.plugins.legend.navigation`
93+
94+
| Name | Type | Default | Description
95+
| ---- | ---- | ------- | -----------
96+
| `display` | `string`\|`boolean` | `false` | Show/hide legend navigation. If `auto` is used, the navigation will be shown only if the legend overflows.
97+
| `color` | [`Color`](../general/colors.md) | `Chart.defaults.color` | Color of the navigation page count label.
98+
| `activeColor` | [`Color`](../general/colors.md) | `Chart.defaults.color` | Color of active navigation arrows.
99+
| `inactiveColor` | [`Color`](../general/colors.md) | 40% opacity of the active color | Color of inactive navigation arrows.
100+
| `arrowSize` | `number` | `12` | Size of navigation arrows.
101+
| `maxCols` | `number` | `1` | Maximum number of columns, in vertical legends, for navigation to be activated.
102+
| `maxRows` | `number` | `3` | Maximum number of rows, in horizontal legends, for navigation to be activated.
103+
| `padding` | [`Padding`](../general/padding.md) | `{ x: 10, y: 10, top: 0 }` | Navigation buttons padding.
104+
| `align` | `string` | `'start'` | Alignment of navigation buttons. Possible options are `start`, `center` and `end`.
105+
| `grid` | `boolean`\|`object` | `true` | Align legends horizontally and vertically. Can be a `boolean` or an object containing `x` and `y` with boolean values ​​indicating whether the axis should be aligned.
106+
| `font` | `Font` | `{ weight: 'bold', size: 14 }` | Font style of the navigation page count label. See [Fonts](../general/fonts.md)
107+
89108
## Legend Item Interface
90109

91110
Items passed to the legend `onClick` function are the ones returned from `labels.generateLabels`. These items must implement the following interface.

0 commit comments

Comments
 (0)