import type { VisualizationOptions, VisualizationTheme } from '../../types'; /** * BarDataItem is the type for each data item in the bar chart. */ export type BarDataItem = { category: string; value: number; group?: string; }; /** * BarConfig defines the configuration for rendering the bar chart. */ export interface BarConfig { type?: 'bar'; data: BarDataItem[]; group?: boolean; stack?: boolean; title?: string; axisXTitle?: string; axisYTitle?: string; theme?: VisualizationTheme; style?: { backgroundColor?: string; palette?: string[]; }; } /** * BarInstance represents a bar chart instance with render and destroy methods. */ export interface BarInstance { render: (config: BarConfig) => void; destroy: () => void; } /** * Bar chart component using G2 5.0. * * @example * ```ts * const bar = Bar({ * container: '#container', * width: 600, * height: 400, * }); * * bar.render({ * type: 'bar', * data: [ * { category: '2015 年', value: 80 }, * { category: '2016 年', value: 140 }, * { category: '2017 年', value: 220 }, * ], * title: '海底捞公司外卖收入', * axisXTitle: '年份', * axisYTitle: '金额 (百万元)', * }); * * bar.destroy(); * ``` */ export declare const Bar: (options: VisualizationOptions) => BarInstance;