mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 17:26:55 +08:00
31 lines
560 B
TypeScript
31 lines
560 B
TypeScript
import {BaseChart} from "@/views/chat/component/BaseChart.ts";
|
|
import {Chart} from '@antv/g2';
|
|
|
|
export abstract class BaseG2Chart extends BaseChart {
|
|
|
|
chart: Chart;
|
|
|
|
constructor(id: string, name: string) {
|
|
super(id, name)
|
|
this.chart = new Chart({
|
|
container: id,
|
|
autoFit: true,
|
|
})
|
|
|
|
this.chart.theme({
|
|
view: {
|
|
viewFill: '#FFFFFF',
|
|
},
|
|
})
|
|
}
|
|
|
|
render() {
|
|
this.chart?.render()
|
|
}
|
|
|
|
destroy() {
|
|
this.chart?.destroy()
|
|
}
|
|
|
|
|
|
} |