49 lines
2.0 KiB
TypeScript
49 lines
2.0 KiB
TypeScript
import * as React from 'react';
|
|
import { ChartsSlotProps, ChartsSlots } from "../internals/material/index.js";
|
|
import { ChartProviderProps } from "../context/ChartProvider/index.js";
|
|
import { ChartSeriesType } from "../models/seriesType/config.js";
|
|
import { ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
|
|
import { AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
import { ChartsLocalizationProviderProps } from "../ChartsLocalizationProvider/index.js";
|
|
export type ChartDataProviderProps<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>> = React.PropsWithChildren<ChartProviderProps<TSeries, TSignatures>['pluginParams'] & Pick<ChartProviderProps<TSeries, TSignatures>, 'seriesConfig' | 'plugins'>> & ChartsLocalizationProviderProps & {
|
|
/**
|
|
* Slots to customize charts' components.
|
|
*/
|
|
slots?: Partial<ChartsSlots>;
|
|
/**
|
|
* The props for the slots.
|
|
*/
|
|
slotProps?: Partial<ChartsSlotProps>;
|
|
};
|
|
/**
|
|
* Orchestrates the data providers for the chart components and hooks.
|
|
*
|
|
* Use this component if you have custom HTML components that need to access the chart data.
|
|
*
|
|
* Demos:
|
|
*
|
|
* - [Composition](https://mui.com/x/react-charts/composition/)
|
|
*
|
|
* API:
|
|
*
|
|
* - [ChartDataProvider API](https://mui.com/x/api/charts/chart-data-provider/)
|
|
*
|
|
* @example
|
|
* ```jsx
|
|
* <ChartDataProvider
|
|
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
* >
|
|
* <ChartsSurface>
|
|
* <BarPlot />
|
|
* <ChartsXAxis axisId="x-axis" />
|
|
* </ChartsSurface>
|
|
* {'Custom Legend Component'}
|
|
* </ChartDataProvider>
|
|
* ```
|
|
*/
|
|
declare function ChartDataProvider<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartDataProviderProps<TSeries, TSignatures>): React.JSX.Element;
|
|
declare namespace ChartDataProvider {
|
|
var propTypes: any;
|
|
}
|
|
export { ChartDataProvider }; |