From 483e409afdafeae275076a80c459553399df1b5e Mon Sep 17 00:00:00 2001 From: ziwu7 <263377135@qq.com> Date: Fri, 13 Dec 2024 21:00:21 +0800 Subject: [PATCH] =?UTF-8?q?ECharts-JSX=20=E9=87=8D=E5=86=99=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/page/Map/component/EChartsMap.tsx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/source/page/Map/component/EChartsMap.tsx b/source/page/Map/component/EChartsMap.tsx index 7343bee..e9292e1 100644 --- a/source/page/Map/component/EChartsMap.tsx +++ b/source/page/Map/component/EChartsMap.tsx @@ -1,3 +1,6 @@ +import 'echarts-jsx/dist/renderers/SVG'; +import 'echarts-jsx/dist/components/geo'; + import { DataObject } from 'dom-renderer'; import { EChartsOption, EChartsType, init, registerMap } from 'echarts'; import { observable } from 'mobx'; @@ -117,14 +120,21 @@ export class EChartsMap properties.name = long2short(properties.name); registerMap(mapName, data); - - chart.setOption(chartOptions); - + + this.renderChart(chartOptions); this.adjustLabel(); - chart.hideLoading(); } - + renderChart(chartOptions: EChartsOption) { + return ( + + + + ); + } updateChartData = (newData: Province[]) => this.chart.setOption({ series: [