UNPKG

@mui/x-charts

Version:

The community edition of the Charts components (MUI X).

27 lines (26 loc) 1.08 kB
import * as React from 'react'; import { ColorLegendSelector, PiecewiseLabelFormatterParams } from './legend.types'; import { LegendPerItemProps } from './LegendPerItem'; export interface PiecewiseColorLegendProps extends ColorLegendSelector, Omit<LegendPerItemProps, 'itemsToDisplay'> { /** * Hide the first item of the legend, corresponding to the [-infinity, min] piece. * @default false */ hideFirst?: boolean; /** * Hide the last item of the legend, corresponding to the [max, +infinity] piece. * @default false */ hideLast?: boolean; /** * Format the legend labels. * @param {PiecewiseLabelFormatterParams} params The bound of the piece to format. * @returns {string|null} The displayed label, or `null` to skip the item. */ labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null; } declare function PiecewiseColorLegend(props: PiecewiseColorLegendProps): React.JSX.Element | null; declare namespace PiecewiseColorLegend { var propTypes: any; } export { PiecewiseColorLegend };