@mui/x-charts
Version:
The community edition of MUI X Charts components.
33 lines • 1.41 kB
text/typescript
import * as React from 'react';
import { type SxProps, type Theme } from '@mui/material/styles';
import type { Direction } from "./direction.mjs";
import { type SeriesLegendItemContext } from "./legendContext.types.mjs";
import { type ChartsLegendClasses } from "./chartsLegendClasses.mjs";
export interface ChartsLegendProps {
/**
* Callback fired when a legend item is clicked.
* @param {React.MouseEvent<HTMLButtonElement, MouseEvent>} event The click event.
* @param {SeriesLegendItemContext} legendItem The legend item data.
* @param {number} index The index of the clicked legend item.
*/
onItemClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>, legendItem: SeriesLegendItemContext, index: number) => void;
/**
* The direction of the legend layout.
* The default depends on the chart.
*/
direction?: Direction;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<ChartsLegendClasses>;
/**
* If `true`, clicking on a legend item will toggle the visibility of the corresponding series.
* @default false
*/
toggleVisibilityOnClick?: boolean;
className?: string;
sx?: SxProps<Theme>;
tabIndex?: number;
}
declare const ChartsLegend: React.ForwardRefExoticComponent<ChartsLegendProps & import("./chartsLegend.types.mjs").ChartsLegendSlotExtension & React.RefAttributes<{}>>;
export { ChartsLegend };