Commit 00d82801 authored by leon's avatar leon

feat:map tooltip display

parent c2472302
......@@ -12,6 +12,7 @@
import uniEcCanvas from '@/uni-ec-canvas/uni-ec-canvas'
import echartElementData from '@/mixins/echartElementData.js'
import { geoCoordMapList } from '@/uni-ec-canvas/geoCoordMap.js'
import { DATAZOOM_DEFAULT } from '@/mixins/zoomConfig.js'
let chart = null
export default {
name:"BarMixMap",
......@@ -74,7 +75,7 @@
...this.elementInfo.option.yAxis,
data: this.dealSeriesData(series).categories
},
dataZoom: this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? this.elementInfo.dataZoom : [],
dataZoom: this.elementInfo.dataZoom && this.elementInfo.dataZoom.show ? [{...this.elementInfo.dataZoom,...DATAZOOM_DEFAULT}] : [{show: false}],
series: {
id: 'associate',
type: 'bar',
......@@ -128,6 +129,17 @@
},
visualMap: this.elementInfo.option.visualMap.show ? [this.elementInfo.option.visualMap] : [],
animationDurationUpdate: 1000,
tooltip: {
show: this.elementInfo.option.dataset.show,
trigger: 'item',
formatter: (value) => {
if(this.elementInfo.option.dataset.formatter) {
return this.$u.common.converFunction(this.elementInfo.option.dataset.formatter, value)
} else {
return `${value.data.name}:${value.data.value[2]}`
}
}
},
series: [{
id: 'associate',
type: 'map',
......@@ -149,12 +161,12 @@
},
label: {
show: this.elementInfo.option.dataset.show,
position: 'right',
position: 'inside',
formatter: (value) => {
if(this.elementInfo.option.dataset.formatter) {
return this.$u.common.converFunction(this.elementInfo.option.dataset.formatter, value)
} else {
return this.elementInfo.option.dataset.show ? `${value.data.name}:${value.data.value[2]}` : value.data.name
return this.elementInfo.option.dataset.show ? value.data.name : ""
}
},
fontSize: this.elementInfo.option.dataset.fontSize,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment