import React from 'react'; import { ChartContainerProps } from '../components'; import { StatisticConfigType } from '../hooks/useChartStatistic'; export interface FunnelChartDataItem { /** 数据类别 */ category?: string; /** 数据类型 */ type?: string; /** X轴值 */ x: number | string; /** Y轴值 */ y: number | string; /** 筛选标签 */ filterLabel?: string; /** 当前层与下一层的比率(百分比,0-100,最后一层可为0)*/ ratio?: number | string; } export interface FunnelChartProps extends ChartContainerProps { /** 扁平化数据数组(x 为阶段名,y 为数值) */ data: FunnelChartDataItem[]; /** 图表标题 */ title?: string; /** 图表宽度,默认600px */ width?: number | string; /** 图表高度,默认400px */ height?: number | string; /** 自定义CSS类名 */ className?: string; /** 数据时间 */ dataTime?: string; /** 图表主题 */ theme?: 'dark' | 'light'; /** 自定义主色 */ color?: string; /** 是否显示图例,默认true */ showLegend?: boolean; /** 图例位置 */ legendPosition?: 'top' | 'left' | 'bottom' | 'right'; /** 图例水平对齐方式 */ legendAlign?: 'start' | 'center' | 'end'; /** 是否显示百分比(相对第一层) */ showPercent?: boolean; /** 头部工具条额外按钮 */ toolbarExtra?: React.ReactNode; /** 是否将过滤器渲染到工具栏 */ renderFilterInToolbar?: boolean; /** 最底层的最小宽度占比(0-1),相对于最顶层的宽度,0-不限制 */ bottomLayerMinWidth?: number; /** ChartStatistic组件配置:object表示单个配置,array表示多个配置 */ statistic?: StatisticConfigType; typeNames?: { rate?: string; /** 类型名称,用于图例和数据集标签 */ name: string; }; /** 是否显示加载状态(当图表未闭合时显示) */ loading?: boolean; } declare const FunnelChart: React.FC; export default FunnelChart;