You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The chart legend displays data about the datasets that are appearing on the chart.
## Configuration options
Namespace: `options.plugins.legend`, the global options for the chart legend is defined in `Chart.defaults.plugins.legend`.
| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
| `display` | `boolean` | `true` | Is the legend shown?
| `position` | `string` | `'top'` | Position of the legend. [more...](#position)
| `align` | `string` | `'center'` | Alignment of the legend. [more...](#align)
| `maxHeight` | `number` | | Maximum height of the legend, in pixels
| `maxWidth` | `number` | | Maximum width of the legend, in pixels
| `fullSize` | `boolean` | `true` | Marks that this box should take the full width/height of the canvas (moving other boxes). This is unlikely to need to be changed in day-to-day use.
| `onClick` | `function` | | A callback that is called when a click event is registered on a label item. Arguments: `[event, legendItem, legend]`.
| `onHover` | `function` | | A callback that is called when a 'mousemove' event is registered on top of a label item. Arguments: `[event, legendItem, legend]`.
| `onLeave` | `function` | | A callback that is called when a 'mousemove' event is registered outside of a previously hovered label item. Arguments: `[event, legendItem, legend]`.
| `reverse` | `boolean` | `false` | Legend will show datasets in reverse order.
| `labels` | `object` | | See the [Legend Label Configuration](#legend-label-configuration) section below.
| `rtl` | `boolean` | | `true` for rendering the legends from right to left.
| `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
| `title` | `object` | | See the [Legend Title Configuration](#legend-title-configuration) section below.
## Position
Current Behavior
LegendOptions in index.esm.d.ts has no maxHeight and maxWidth, which causes eslint errors when developing in TypeScript
* Generates legend items for each thing in the legend. Default implementation returns the text + styling for the color box. See Legend Item for details.
*/
generateLabels(chart: Chart): LegendItem[];
/**
* Filters legend items out of the legend. Receives 2 parameters, a Legend Item and the chart data
Expected Behavior
LegendOptions
in the doc hasmaxHeight
andmaxWidth
Chart.js/docs/configuration/legend.md
Lines 1 to 26 in 26f8d7b
Current Behavior
LegendOptions
inindex.esm.d.ts
has nomaxHeight
andmaxWidth
, which causes eslint errors when developing in TypeScriptChart.js/types/index.esm.d.ts
Lines 2106 to 2227 in 26f8d7b
Possible Solution
Add those missing props to
index.esm.d.ts
.Steps to Reproduce
Please refer to the code snippets above.
Context
Please refer to the code snippets above.
Environment
The text was updated successfully, but these errors were encountered: