@mui/x-charts
Version:
The community edition of MUI X Charts components.
33 lines • 1.4 kB
TypeScript
import * as React from 'react';
import { type SxProps, type Theme } from '@mui/material/styles';
import type { Direction } from "./direction.js";
import { type SeriesLegendItemContext } from "./legendContext.types.js";
import { type ChartsLegendClasses } from "./chartsLegendClasses.js";
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.js").ChartsLegendSlotExtension & React.RefAttributes<{}>>;
export { ChartsLegend };