90 lines
3.8 KiB
TypeScript
90 lines
3.8 KiB
TypeScript
import * as React from 'react';
|
|
import { MakeOptional } from '@mui/x-internals/types';
|
|
import { ChartsSlots, ChartsSlotProps } from "../internals/material/index.js";
|
|
import { AreaPlotProps, AreaPlotSlotProps, AreaPlotSlots } from "./AreaPlot.js";
|
|
import { LinePlotProps, LinePlotSlotProps, LinePlotSlots } from "./LinePlot.js";
|
|
import { ChartContainerProps } from "../ChartContainer/index.js";
|
|
import { MarkPlotProps, MarkPlotSlotProps, MarkPlotSlots } from "./MarkPlot.js";
|
|
import { ChartsAxisProps } from "../ChartsAxis/ChartsAxis.js";
|
|
import { LineSeriesType } from "../models/seriesType/line.js";
|
|
import { ChartsTooltipSlots, ChartsTooltipSlotProps } from "../ChartsTooltip/ChartTooltip.types.js";
|
|
import { ChartsLegendSlotProps, ChartsLegendSlots } from "../ChartsLegend/index.js";
|
|
import { ChartsAxisHighlightProps } from "../ChartsAxisHighlight/index.js";
|
|
import { ChartsAxisSlotProps, ChartsAxisSlots } from "../models/axis.js";
|
|
import { LineHighlightPlotSlots, LineHighlightPlotSlotProps } from "./LineHighlightPlot.js";
|
|
import { ChartsGridProps } from "../ChartsGrid/index.js";
|
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "../ChartsOverlay/index.js";
|
|
import { LineChartPluginsSignatures } from "./LineChart.plugins.js";
|
|
import { ChartsToolbarSlots, ChartsToolbarSlotProps } from "../Toolbar/index.js";
|
|
export interface LineChartSlots extends ChartsAxisSlots, AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
export interface LineChartSlotProps extends ChartsAxisSlotProps, AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
export type LineSeries = MakeOptional<LineSeriesType, 'type'>;
|
|
export interface LineChartProps extends Omit<ChartContainerProps<'line', LineChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
/**
|
|
* The series to display in the line chart.
|
|
* An array of [[LineSeries]] objects.
|
|
*/
|
|
series: Readonly<LineSeries[]>;
|
|
/**
|
|
* Option to display a cartesian grid in the background.
|
|
*/
|
|
grid?: Pick<ChartsGridProps, 'vertical' | 'horizontal'>;
|
|
/**
|
|
* The configuration of axes highlight.
|
|
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
* @default { x: 'line' }
|
|
*/
|
|
axisHighlight?: ChartsAxisHighlightProps;
|
|
/**
|
|
* If `true`, the legend is not rendered.
|
|
*/
|
|
hideLegend?: boolean;
|
|
/**
|
|
* If `true`, render the line highlight item.
|
|
*/
|
|
disableLineItemHighlight?: boolean;
|
|
/**
|
|
* Overridable component slots.
|
|
* @default {}
|
|
*/
|
|
slots?: LineChartSlots;
|
|
/**
|
|
* The props used for each component slot.
|
|
* @default {}
|
|
*/
|
|
slotProps?: LineChartSlotProps;
|
|
/**
|
|
* Callback fired when an area element is clicked.
|
|
*/
|
|
onAreaClick?: AreaPlotProps['onItemClick'];
|
|
/**
|
|
* Callback fired when a line element is clicked.
|
|
*/
|
|
onLineClick?: LinePlotProps['onItemClick'];
|
|
/**
|
|
* Callback fired when a mark element is clicked.
|
|
*/
|
|
onMarkClick?: MarkPlotProps['onItemClick'];
|
|
/**
|
|
* If `true`, animations are skipped.
|
|
* @default false
|
|
*/
|
|
skipAnimation?: boolean;
|
|
/**
|
|
* If true, shows the default chart toolbar.
|
|
* @default false
|
|
*/
|
|
showToolbar?: boolean;
|
|
}
|
|
/**
|
|
* Demos:
|
|
*
|
|
* - [Lines](https://mui.com/x/react-charts/lines/)
|
|
* - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
|
|
*
|
|
* API:
|
|
*
|
|
* - [LineChart API](https://mui.com/x/api/charts/line-chart/)
|
|
*/
|
|
declare const LineChart: React.ForwardRefExoticComponent<LineChartProps & React.RefAttributes<SVGSVGElement>>;
|
|
export { LineChart }; |