import type { VisualizationOptions, VisualizationTheme } from '../../types'; /** * LineDataItem is the type for each data item in the line chart. */ export type LineDataItem = { time: string | number; value: number; group?: string; }; /** * LineConfig defines the configuration for rendering the line chart. */ export interface LineConfig { type?: 'line'; data: LineDataItem[]; title?: string; axisXTitle?: string; axisYTitle?: string; theme?: VisualizationTheme; style?: { backgroundColor?: string; palette?: string[]; lineWidth?: number; }; } /** * LineInstance represents a line chart instance with render and destroy methods. */ export interface LineInstance { render: (config: LineConfig) => void; destroy: () => void; } /** * Line chart component using G2 5.0. * * @example * ```ts * const line = Line({ * container: '#container', * width: 600, * height: 400, * }); * * line.render({ * type: 'line', * data: [ * { time: '2015 年', value: 1700 }, * { time: '2016 年', value: 1500 }, * { time: '2017 年', value: 1200 }, * ], * title: '出生人口变化', * axisXTitle: '年份', * axisYTitle: '出生人口(万人)', * }); * * line.destroy(); * ``` */ export declare const Line: (options: VisualizationOptions) => LineInstance;