74 lines
3.2 KiB
TypeScript
74 lines
3.2 KiB
TypeScript
import * as React from 'react';
|
|
import { MakeOptional } from '@mui/x-internals/types';
|
|
import { ChartsSlotProps, ChartsSlots } from "../internals/material/index.js";
|
|
import { ChartsToolbarSlotProps, ChartsToolbarSlots } from "../Toolbar/index.js";
|
|
import { BarPlotProps, BarPlotSlotProps, BarPlotSlots } from "./BarPlot.js";
|
|
import { ChartContainerProps } from "../ChartContainer/index.js";
|
|
import { ChartsAxisProps } from "../ChartsAxis/index.js";
|
|
import { BarSeriesType } from "../models/seriesType/bar.js";
|
|
import { ChartsTooltipSlots, ChartsTooltipSlotProps } from "../ChartsTooltip/ChartTooltip.types.js";
|
|
import { ChartsLegendSlots, ChartsLegendSlotProps } from "../ChartsLegend/index.js";
|
|
import { ChartsAxisHighlightProps } from "../ChartsAxisHighlight/index.js";
|
|
import { ChartsAxisSlots, ChartsAxisSlotProps } from "../models/axis.js";
|
|
import { ChartsGridProps } from "../ChartsGrid/index.js";
|
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "../ChartsOverlay/ChartsOverlay.js";
|
|
import { BarChartPluginsSignatures } from "./BarChart.plugins.js";
|
|
export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
export type BarSeries = MakeOptional<BarSeriesType, 'type'>;
|
|
export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis' | 'experimentalFeatures'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
/**
|
|
* The series to display in the bar chart.
|
|
* An array of [[BarSeries]] objects.
|
|
*/
|
|
series: Readonly<BarSeries[]>;
|
|
/**
|
|
* Option to display a cartesian grid in the background.
|
|
*/
|
|
grid?: Pick<ChartsGridProps, 'vertical' | 'horizontal'>;
|
|
/**
|
|
* The configuration of axes highlight.
|
|
* Default is set to 'band' in the bar direction.
|
|
* Depends on `layout` prop.
|
|
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
*
|
|
*/
|
|
axisHighlight?: ChartsAxisHighlightProps;
|
|
/**
|
|
* If `true`, the legend is not rendered.
|
|
*/
|
|
hideLegend?: boolean;
|
|
/**
|
|
* Overridable component slots.
|
|
* @default {}
|
|
*/
|
|
slots?: BarChartSlots;
|
|
/**
|
|
* The props used for each component slot.
|
|
* @default {}
|
|
*/
|
|
slotProps?: BarChartSlotProps;
|
|
/**
|
|
* The direction of the bar elements.
|
|
* @default 'vertical'
|
|
*/
|
|
layout?: BarSeriesType['layout'];
|
|
/**
|
|
* If true, shows the default chart toolbar.
|
|
* @default false
|
|
*/
|
|
showToolbar?: boolean;
|
|
}
|
|
/**
|
|
* 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<SVGSVGElement>>;
|
|
export { BarChart }; |