diff --git a/source/page/Map/component/EChartsMap.tsx b/source/page/Map/component/EChartsMap.tsx index 7343bee..9979ed9 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'; @@ -107,7 +110,7 @@ export class EChartsMap } async loadData() { - const { chart, mapUrl, mapName, chartOptions } = this; + const { chart, mapUrl, mapName } = this; chart.showLoading(); @@ -117,14 +120,22 @@ export class EChartsMap properties.name = long2short(properties.name); registerMap(mapName, data); - - chart.setOption(chartOptions); - + this.adjustLabel(); - chart.hideLoading(); } - + render() { + const options = this.chartOptions; + + return ( + + + + ); + } updateChartData = (newData: Province[]) => this.chart.setOption({ series: [