UNPKG

@linkdesign/screen

Version:

屏组件库,但使用场景又不局限于屏。主要用于BI、大盘和屏

56 lines (55 loc) 1.16 kB
import React, { PureComponent } from 'react'; import { Chart } from '@antv/g2'; import { ChartCfg, Options } from '@antv/g2/lib/interface'; import { ITitle, UniversalStyle } from '../title'; interface IProps { /** * 类名 */ className?: string; /** * 图表标题 */ title?: React.ReactNode; /** * 通用样式 */ universalStyle?: UniversalStyle; /** * 标题配置 */ titleOptions?: ITitle; /** * 初始化回调 * * @param chart ECharts */ onInit?: (chart: Chart) => void; /** * g2 构造方法的入参 */ config: ChartCfg; /** * g2 options配置 */ options: Options; } /** * G2图表 * * @class G2Chart * @extends {PureComponent<IProps>} */ declare class G2Chart extends PureComponent<IProps> { private containerRef; private titleRef; private chartRef; private chart; private containerHeight; constructor(props: IProps); componentDidMount(): void; componentDidUpdate(prevProps: IProps): void; componentWillUnmount(): void; render(): React.ReactNode; } export default G2Chart;