UNPKG

@mui/x-charts

Version:

The community edition of MUI X Charts components.

55 lines 2.68 kB
import * as React from 'react'; import { PieChartPluginSignatures } from "../PieChart/PieChart.plugins.js"; import { BarChartPluginsSignatures } from "../BarChart/BarChart.plugins.js"; import { ScatterChartPluginsSignatures } from "../ScatterChart/ScatterChart.plugins.js"; import { LineChartPluginsSignatures } from "../LineChart/LineChart.plugins.js"; import { ChartSeriesType } from "../models/seriesType/config.js"; import { ChartDataProviderProps } from "../ChartDataProvider/index.js"; import { ChartsSurfaceProps } from "../ChartsSurface/index.js"; import { AllPluginSignatures, DefaultPluginSignatures } from "../internals/plugins/allPlugins.js"; import { ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js"; import { ChartPublicAPI } from "../internals/plugins/models/index.js"; export type ChartContainerProps<SeriesType extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<SeriesType>> = Omit<ChartDataProviderProps<SeriesType, TSignatures>, 'children'> & ChartsSurfaceProps; type PluginsPerSeriesType = { line: LineChartPluginsSignatures; scatter: ScatterChartPluginsSignatures; bar: BarChartPluginsSignatures; pie: PieChartPluginSignatures; composition: DefaultPluginSignatures; }; /** * The API of the chart `apiRef` object. * The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type. * @example ChartApi<'bar'> * If the chart is being created using composition, the `composition` value can be used. * @example ChartApi<'composition'> */ export type ChartApi<TSeries extends keyof PluginsPerSeriesType | undefined = undefined, TSignatures extends readonly ChartAnyPluginSignature[] = (TSeries extends keyof PluginsPerSeriesType ? PluginsPerSeriesType[TSeries] : AllPluginSignatures)> = ChartPublicAPI<TSignatures>; /** * It sets up the data providers as well as the `<svg>` for the chart. * * This is a combination of both the `ChartDataProvider` and `ChartsSurface` components. * * Demos: * * - [Composition](https://mui.com/x/api/charts/composition/) * * API: * * - [ChartContainer API](https://mui.com/x/api/charts/chart-container/) * * @example * ```jsx * <ChartContainer * series={[{ label: "Label", type: "bar", data: [10, 20] }]} * xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]} * > * <BarPlot /> * <ChartsXAxis axisId="x-axis" /> * </ChartContainer> * ``` */ declare const ChartContainer: <TSeries extends ChartSeriesType>(props: ChartContainerProps<TSeries> & { ref?: React.ForwardedRef<SVGSVGElement>; }) => React.JSX.Element; export { ChartContainer };