This commit is contained in:
2025-09-08 16:37:47 +08:00
parent be1ee68229
commit a05dde6c52

View File

@@ -0,0 +1,29 @@
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,
padding: 'auto',
})
this.chart.theme({
view: {
viewFill: '#FFFFFF',
},
})
}
render() {
this.chart?.render()
}
destroy() {
this.chart?.destroy()
}
}