Commit 00d82801 authored by leon's avatar leon

feat:map tooltip display

parent c2472302
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
import uniEcCanvas from '@/uni-ec-canvas/uni-ec-canvas' import uniEcCanvas from '@/uni-ec-canvas/uni-ec-canvas'
import echartElementData from '@/mixins/echartElementData.js' import echartElementData from '@/mixins/echartElementData.js'
import { geoCoordMapList } from '@/uni-ec-canvas/geoCoordMap.js' import { geoCoordMapList } from '@/uni-ec-canvas/geoCoordMap.js'
import { DATAZOOM_DEFAULT } from '@/mixins/zoomConfig.js'
let chart = null let chart = null
export default { export default {
name:"BarMixMap", name:"BarMixMap",
...@@ -74,7 +75,7 @@ ...@@ -74,7 +75,7 @@
...this.elementInfo.option.yAxis, ...this.elementInfo.option.yAxis,
data: this.dealSeriesData(series).categories 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: { series: {
id: 'associate', id: 'associate',
type: 'bar', type: 'bar',
...@@ -128,6 +129,17 @@ ...@@ -128,6 +129,17 @@
}, },
visualMap: this.elementInfo.option.visualMap.show ? [this.elementInfo.option.visualMap] : [], visualMap: this.elementInfo.option.visualMap.show ? [this.elementInfo.option.visualMap] : [],
animationDurationUpdate: 1000, 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: [{ series: [{
id: 'associate', id: 'associate',
type: 'map', type: 'map',
...@@ -149,12 +161,12 @@ ...@@ -149,12 +161,12 @@
}, },
label: { label: {
show: this.elementInfo.option.dataset.show, show: this.elementInfo.option.dataset.show,
position: 'right', position: 'inside',
formatter: (value) => { formatter: (value) => {
if(this.elementInfo.option.dataset.formatter) { if(this.elementInfo.option.dataset.formatter) {
return this.$u.common.converFunction(this.elementInfo.option.dataset.formatter, value) return this.$u.common.converFunction(this.elementInfo.option.dataset.formatter, value)
} else { } 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, 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