import React from 'react'; import { ChartContainerProps } from '../components'; import { StatisticConfigType } from '../hooks'; import type { ChartClassNames, ChartStyles } from '../types/classNames'; /** * 直方图数据项接口 */ export interface HistogramChartDataItem { /** 原始数据值(自动分箱时为原始数值;预分箱时为该箱的 y 轴值) */ value: number; /** 预分箱左边界(设置后与 right 一起跳过自动分箱) */ left?: number; /** 预分箱右边界 */ right?: number; /** 数据系列(用于分组显示) */ type?: string; /** 分类(用于筛选) */ category?: string; /** 筛选标签 */ filterLabel?: string; } export interface HistogramChartProps extends ChartContainerProps { /** 扁平化数据数组 */ data: HistogramChartDataItem[]; /** 图表标题 */ title?: string; /** 图表宽度,默认600px */ width?: number | string; /** 图表高度,默认400px */ height?: number | string; /** 自定义CSS类名 */ className?: string; /** 自定义CSS类名(支持对象格式,为每层DOM设置类名) */ classNames?: ChartClassNames; /** 数据时间 */ dataTime?: string; /** 图表主题 */ theme?: 'dark' | 'light'; /** 自定义主色 */ color?: string | string[]; /** 是否显示图例,默认true */ showLegend?: boolean; /** 图例位置 */ legendPosition?: 'top' | 'left' | 'bottom' | 'right'; /** 是否显示网格线,默认true */ showGrid?: boolean; /** X轴标签 */ xAxisLabel?: string; /** Y轴标签 */ yAxisLabel?: string; /** 是否堆叠显示,默认true */ stacked?: boolean; /** 自定义分箱数量(不设置则自动计算) */ binCount?: number; /** 是否显示频率而非计数 */ showFrequency?: boolean; /** 头部工具条额外按钮 */ toolbarExtra?: React.ReactNode; /** 是否将过滤器渲染到工具栏 */ renderFilterInToolbar?: boolean; /** ChartStatistic组件配置 */ statistic?: StatisticConfigType; /** 是否显示加载状态 */ loading?: boolean; /** 自定义样式对象 */ styles?: ChartStyles; } declare const HistogramChart: React.FC; export default HistogramChart;