|
|
@@ -1,25 +1,12 @@
|
|
|
<template>
|
|
|
- <el-row>
|
|
|
- <el-col :md="16">
|
|
|
- <div ref="chartsDOM" style="width: 800px;height:600px;" />
|
|
|
- </el-col>
|
|
|
- <el-col :md="8">
|
|
|
- <el-card>
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span>ChartMap</span>
|
|
|
- <el-button style="float: right; padding: 3px 0" type="text" @click="onRefresh">更新</el-button>
|
|
|
- </div>
|
|
|
- <div id="chart2" style="height:400px;" />
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <div ref="chartsDOM" style="width: 1080px;height:960px;" />
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import * as echarts from 'echarts'
|
|
|
import { getChartGeoJson } from '@/api/chart'
|
|
|
-// import chinaData from '@/assets/json/china.json'
|
|
|
-// import sichuanData from '@/assets/json/sichuan_full.json'
|
|
|
+// import chinaData from '@/assets/json/china_full.json'
|
|
|
+// import sichuanData from '@/assets/json/sichuan_level3.json'
|
|
|
|
|
|
export default {
|
|
|
name: 'ChartMap',
|
|
|
@@ -32,7 +19,7 @@ export default {
|
|
|
// 初始化统计图对象
|
|
|
this.myChart = echarts.init(this.$refs['chartsDOM'])
|
|
|
// this.initChart1()
|
|
|
- this.initChart2()
|
|
|
+ // this.initChart2()
|
|
|
},
|
|
|
created() {
|
|
|
document.title = 'ChartMap'
|
|
|
@@ -48,9 +35,12 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- var mapName = 'china'
|
|
|
+ var mapName = 'sichuan'
|
|
|
var mapData = {}
|
|
|
+
|
|
|
+ // mapName = 'china'
|
|
|
// mapData = chinaData
|
|
|
+
|
|
|
var dataList = this.getDataList(mapData, 1000)
|
|
|
var chartOption = this.getChartOption1(mapName, dataList)
|
|
|
// 注册地图(地图数据来自本地或后端的 geojson 格式数据)
|
|
|
@@ -129,7 +119,7 @@ export default {
|
|
|
map: mapName,
|
|
|
roam: true,
|
|
|
label: {
|
|
|
- show: true
|
|
|
+ show: false
|
|
|
},
|
|
|
data: dataList // 数据
|
|
|
}]
|