From 40098aaab4e7bf0b2fb189320ec27fb2ee5adeb7 Mon Sep 17 00:00:00 2001 From: inter Date: Mon, 8 Sep 2025 16:37:46 +0800 Subject: [PATCH] Add File --- .../src/views/chat/component/BaseChart.ts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 frontend/src/views/chat/component/BaseChart.ts diff --git a/frontend/src/views/chat/component/BaseChart.ts b/frontend/src/views/chat/component/BaseChart.ts new file mode 100644 index 0000000..4a24d12 --- /dev/null +++ b/frontend/src/views/chat/component/BaseChart.ts @@ -0,0 +1,32 @@ +export interface ChartAxis { + name: string + value: string + type?: 'x' | 'y' | 'series' +} + +export interface ChartData { + [key: string]: any +} + +export type ChartTypes = 'table' | 'bar' | 'column' | 'line' | 'pie' + +export abstract class BaseChart { + id: string + _name: string = 'base-chart' + axis: Array = [] + data: Array = [] + + constructor(id: string, name: string) { + this.id = id + this._name = name + } + + init(axis: Array, data: Array): void { + this.axis = axis + this.data = data + } + + abstract render(): void + + abstract destroy(): void +}