From 6431cc32104f654ae102ab18b68856a4e8a73586 Mon Sep 17 00:00:00 2001 From: hiStephen <30630927+1004801012@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:38:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20echarts=E6=8C=89=E9=9C=80=E5=BC=95?= =?UTF-8?q?=E5=85=A5=20(#332)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/management/hooks/useCharts.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/web/src/management/hooks/useCharts.js b/web/src/management/hooks/useCharts.js index e15583f7..089d59ac 100644 --- a/web/src/management/hooks/useCharts.js +++ b/web/src/management/hooks/useCharts.js @@ -1,6 +1,25 @@ -import * as echarts from 'echarts' +import * as echarts from 'echarts/core' +import { BarChart, PieChart, GaugeChart } from 'echarts/charts' +import { + TooltipComponent, + TitleComponent, + GridComponent, + LegendComponent +} from 'echarts/components' +import { CanvasRenderer } from 'echarts/renderers' import { getOption } from '@/management/config/chartConfig' +echarts.use([ + TitleComponent, + TooltipComponent, + GridComponent, + LegendComponent, + BarChart, + PieChart, + GaugeChart, + CanvasRenderer +]) + /** * 绘制图表 * @param {Object} el