UNPKG

@mui/x-charts

Version:

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

55 lines (54 loc) 2.53 kB
import * as React from 'react'; import { BarPlotProps, BarPlotSlotComponentProps, BarPlotSlotsComponent } from './BarPlot'; import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer'; import { ChartsAxisProps } from '../ChartsAxis'; import { BarSeriesType } from '../models/seriesType/bar'; import { MakeOptional } from '../models/helpers'; import { ChartsTooltipProps, ChartsTooltipSlotComponentProps, ChartsTooltipSlotsComponent } from '../ChartsTooltip'; import { ChartsLegendProps, ChartsLegendSlotsComponent, ChartsLegendSlotComponentProps } from '../ChartsLegend'; import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight'; import { ChartsAxisSlotsComponent, ChartsAxisSlotComponentProps } from '../models/axis'; export interface BarChartSlotsComponent extends ChartsAxisSlotsComponent, BarPlotSlotsComponent, ChartsLegendSlotsComponent, ChartsTooltipSlotsComponent { } export interface BarChartSlotComponentProps extends ChartsAxisSlotComponentProps, BarPlotSlotComponentProps, ChartsLegendSlotComponentProps, ChartsTooltipSlotComponentProps { } export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Pick<BarPlotProps, 'skipAnimation'> { series: MakeOptional<BarSeriesType, 'type'>[]; tooltip?: ChartsTooltipProps; /** * Object `{ x, y }` that defines how the charts highlight the mouse position along the x- and y-axes. * The two properties accept the following values: * - 'none': display nothing. * - 'line': display a line at the current mouse position. * - 'band': display a band at the current mouse position. Only available with band scale. */ axisHighlight?: ChartsAxisHighlightProps; /** * @deprecated Consider using `slotProps.legend` instead. */ legend?: ChartsLegendProps; /** * Overridable component slots. * @default {} */ slots?: BarChartSlotsComponent; /** * The props used for each component slot. * @default {} */ slotProps?: BarChartSlotComponentProps; layout?: BarSeriesType['layout']; } /** * Demos: * * - [Bars](https://mui.com/x/react-charts/bars/) * - [Bar demonstration](https://mui.com/x/react-charts/bar-demo/) * - [Stacking](https://mui.com/x/react-charts/stacking/) * * API: * * - [BarChart API](https://mui.com/x/api/charts/bar-chart/) */ declare const BarChart: React.ForwardRefExoticComponent<BarChartProps & React.RefAttributes<unknown>>; export { BarChart };