PieChartLegendProps
Defines the configuration options for the pie chart legend.
Props
The following table outlines the props for the PieChartLegendProps:
| Name | Type | Default | Description |
|---|---|---|---|
| accessibility | { ariaLabel: null, focusable: true, role: null, tabIndex: 0 } | Provides options to enhance accessibility for screen readers and keyboard navigation. | |
| align | Center | Specifies the alignment of the legend within its container region in the chart. The behavior of this property depends on the legend's position:
| |
| background | string | transparent | Sets the background color for the legend area. Can use any valid CSS color format including hex, rgb, or named colors. |
| border | { width: 1, color: '', dashArray: '' } | Customizes the border around the entire legend area. Controls color, width, and dash pattern of the legend's outer frame. | |
| containerPadding | { left: 0, right: 0, top: 0, bottom: 0 } | Sets the internal spacing between the legend border and its content. Creates visual breathing room within the legend container for better readability. | |
| enablePages | boolean | true | When set to |
| fixedWidth | boolean | false | When enabled, forces all legend items to have the same width. Creates a more uniform, grid-like appearance for the legend. |
| height | string | '' | Specifies the height of the legend area in pixels. |
| imageUrl | string | '' | Specifies the image URL for the legend icon.
Requires |
| inversed | boolean | false | When enabled, reverses the order of elements within each legend item. Places text before the shape/symbol instead of the default shape-then-text order. |
| itemPadding | number | null | null | Controls the horizontal and vertical spacing between adjacent legend items. |
| location | { x: 0, y: 0 } | Specifies the exact coordinates for positioning the legend when using custom positioning.
Contains x and y properties to determine the precise location within the chart container.
The | |
| margin | { left: 0, right: 0, top: 0, bottom: 0 } | Sets the external spacing around the legend, controlling its distance from other chart elements. | |
| maxLabelWidth | number | null | null | Limits the maximum width of individual legend item labels in pixels. Prevents long text from extending beyond the desired width. |
| maxTitleWidth | number | 100 | Limits the maximum width of the legend title in pixels. Text exceeding this width will wrap according to the textWrap property. |
| opacity | number | 1 | Controls the transparency of the entire legend. Values range from 0 (completely transparent) to 1 (fully opaque). |
| padding | number | 8 | Sets the internal padding between the legend border and its content elements. |
| position | Auto | Determines where the legend appears in relation to the chart area. Controls both the orientation of legend items and their overall placement. Available options:
| |
| reverse | boolean | false | When set to |
| shape | SeriesType | Specifies the shape of the legend icon for each data point. Available options:
| |
| shapeHeight | number | 10 | Controls the height of the visual indicator symbol for each legend item. |
| shapePadding | number | 8 | Controls the space between each legend item's shape and its text. |
| shapeWidth | number | 10 | Controls the width of the visual indicator symbol for each legend item. |
| textStyle | { fontStyle: 'Normal', fontSize: '12px', fontWeight: 'Normal', color: '', fontFamily: '' } | Customizes the appearance of text in legend items. | |
| title | string | '' | Specifies a title to be displayed for the legend. The title provides a descriptive heading for the legend items. |
| titleAlign | Center | Determines the alignment of the title within its container. Available options:
| |
| titleOverflow | Wrap | Controls how the title behaves when it overflows its container. Available options:
| |
| titleStyle | { fontStyle: 'Normal', fontSize: '12px', fontWeight: 'Normal', color: '', fontFamily: '' } | Customizes the appearance of the legend title text. | |
| toggleVisibility | boolean | true | Controls whether clicking a legend item toggles the visibility of its corresponding series. When disabled, legend items become informational only without interactive behavior. |
| visible | boolean | true | When set to |
| width | string | '' | Specifies the width of the legend area in pixels. |