import React from 'react'; import { ChartContainerProps } from '../components'; import { StatisticConfigType } from '../hooks/useChartStatistic'; import { ChartDataItem } from '../utils'; export type LineChartDataItem = ChartDataItem; export interface LineChartConfigItem { datasets: Array<(string | { x: number; y: number; })[]>; theme?: 'light' | 'dark'; showLegend?: boolean; legendPosition?: 'top' | 'left' | 'bottom' | 'right'; legendAlign?: 'start' | 'center' | 'end'; showGrid?: boolean; xAxisLabel?: string; yAxisLabel?: string; xAxisMin?: number; xAxisMax?: number; yAxisMin?: number; yAxisMax?: number; xAxisStep?: number; yAxisStep?: number; } export interface LineChartProps extends ChartContainerProps { /** 扁平化数据数组 */ data: LineChartDataItem[]; /** 图表标题 */ title?: string; /** 图表宽度,默认600px */ width?: number | string; /** 图表高度,默认400px */ height?: number | string; /** 自定义CSS类名 */ className?: string; /** 数据时间 */ dataTime?: string; /** 图表主题 */ theme?: 'dark' | 'light'; /** 自定义主色(可选),支持 string 或 string[];数组按序对应各数据序列 */ color?: string | string[]; /** 是否显示图例,默认true */ showLegend?: boolean; /** 图例位置 */ legendPosition?: 'top' | 'left' | 'bottom' | 'right'; /** 图例水平对齐方式 */ legendAlign?: 'start' | 'center' | 'end'; /** 是否显示网格线,默认true */ showGrid?: boolean; /** X轴位置 */ xPosition?: 'top' | 'bottom'; /** Y轴位置 */ yPosition?: 'left' | 'right'; /** 是否隐藏X轴,默认false */ hiddenX?: boolean; /** 是否隐藏Y轴,默认false */ hiddenY?: boolean; /** 头部工具条额外按钮 */ toolbarExtra?: React.ReactNode; /** 是否将过滤器渲染到工具栏 */ renderFilterInToolbar?: boolean; /** ChartStatistic组件配置:object表示单个配置,array表示多个配置 */ statistic?: StatisticConfigType; /** 是否显示加载状态(当图表未闭合时显示) */ loading?: boolean; } declare const LineChart: React.FC; export default LineChart;