NuclearDispersionSystem/ant-design-vue-jeecg/node_modules/@antv/g2/esm/chart/chart.d.ts
2023-09-14 14:47:11 +08:00

52 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { ChartCfg } from '../interface';
import View from './view';
/**
* Chart 类,是使用 G2 进行绘图的入口。
*/
export default class Chart extends View {
/** Chart 的 DOM 容器 */
ele: HTMLElement;
/** 图表宽度 */
width: number;
/** 图表高度 */
height: number;
/** 是否开启局部刷新 */
localRefresh: boolean;
/** 是否自适应 DOM 容器宽高,默认为 false需要用户手动指定宽高 */
autoFit: boolean;
/** 图表渲染引擎 */
renderer: 'canvas' | 'svg';
private wrapperElement;
constructor(props: ChartCfg);
private initDefaultInteractions;
/**
* 改变图表大小,同时重新渲染。
* @param width 图表宽度
* @param height 图表高度
* @returns
*/
changeSize(width: number, height: number): this;
/**
* 销毁图表,同时解绑事件,销毁创建的 G.Canvas 实例。
* @returns void
*/
destroy(): void;
/**
* 显示或隐藏图表
* @param visible 是否可见true 表示显示false 表示隐藏
* @returns
*/
changeVisible(visible: boolean): this;
/**
* 自动根据容器大小 resize 画布
*/
forceFit(): void;
private updateCanvasStyle;
private bindAutoFit;
private unbindAutoFit;
/**
* when container size changed, change chart size props, and re-render.
*/
private onResize;
}