UNPKG

@youwen/ai-design-system

Version:

Enterprise AI-driven design system with comprehensive design tokens

79 lines (78 loc) 1.7 kB
/** * 迷你图表组件 - 无业务语义的通用迷你图表 * 基于v2 HVACMiniChart,移除业务逻辑,支持线图、柱状图、区域图、横向柱状图 */ import React from 'react'; export interface MiniChartProps { /** * 图表类型 * @default 'line' */ type?: 'line' | 'bar' | 'area' | 'horizontal-bar'; /** * 数据数组 */ data: number[]; /** * 图表宽度 * @default 195 */ width?: number; /** * 图表高度 * @default 195 */ height?: number; /** * 是否显示网格线 * @default true */ showGrid?: boolean; /** * 网格线数量 * @default 4 */ gridLines?: number; /** * Y轴标签 */ yAxisLabels?: string[]; /** * X轴标签(用于横向柱状图) */ xAxisLabels?: string[]; /** * 是否显示数据点 * @default true */ showDots?: boolean; /** * 是否显示数值标签 * @default false */ showValues?: boolean; /** * 线条颜色 * @default #6BB5FF */ lineColor?: string; /** * 线条粗细 * @default 2 */ lineThickness?: number; /** * 条形颜色(用于横向柱状图) * @default #6BB5FF */ barColor?: string; /** * 自定义类名 */ className?: string; /** * 自定义样式 */ style?: React.CSSProperties; } export default function MiniChart({ type, data, width, height, showGrid, gridLines, yAxisLabels, xAxisLabels, showDots, showValues, lineColor, lineThickness, barColor, className, style }: MiniChartProps): JSX.Element;