Commit 82a76600 by 胡悦

修复1.1 精品升级地图和趋势分析

1 parent 65c7e3fe
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-07-18 17:27:55
* @LastEditTime: 2023-08-23 16:22:16
* @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -30,27 +30,27 @@ export default {
type: Array,
default: () => []
},
// tooltipFormatterObj: {
// type: Array,
// default: () => {
// return [
// {
// label: '数量',
// attrName: 'num'
// },
// {
// label: '环比',
// attrName: 'hrate',
// addSymbol: '%'
// },
// {
// label: '同比',
// attrName: 'trate',
// addSymbol: '%'
// }
// ]
// }
// }
tooltipFormatterObj: {
type: Array,
default: () => {
return [
{
label: '数量',
attrName: 'num'
},
{
label: '环比',
attrName: 'hrate',
addSymbol: '%'
},
{
label: '同比',
attrName: 'trate',
addSymbol: '%'
}
]
}
}
},
data() {
return {
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-20 10:19:06
* @LastEditors: huyue
* @LastEditTime: 2023-07-26 16:26:03
* @LastEditTime: 2023-08-23 16:15:25
-->
<template>
<div>
......@@ -50,7 +50,16 @@ export default {
type: 'map',
map: 'china',
data: data,
label: {
normal: {
color: '#ffffff'
},
emphasis: {
color: '#ffffff'
}
},
itemStyle: {
color: '#ffffff',
// areaColor: '#061422',
areaColor: {
image: mapBg,
......@@ -58,13 +67,8 @@ export default {
},
borderColor: '#65C6F8',
shadowBlur: 10,
shadowColor: 'rgba(61, 87, 255, 0.41)'
},
emphasis: {
label: {
color: '#fff'
},
itemStyle: {
shadowColor: 'rgba(61, 87, 255, 0.41)',
emphasis: {
areaColor: {
type: 'linear',
x: 0,
......@@ -78,14 +82,18 @@ export default {
}],
global: false // 缺省为 false
}
},
select: {
}
},
select: {
itemStyle: {
// color: this.clickcolor, // 设置地图点击后的颜色
color: '#ffffff', // 设置地图点击后的颜色
areaColor: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
x2: 1,
y2: 0,
colorStops: [{
offset: 0, color: '#079FF1' // 0% 处的颜色
}, {
......@@ -94,7 +102,7 @@ export default {
global: false // 缺省为 false
}
}
}
},
}]
}
return option
......@@ -102,6 +110,75 @@ export default {
drawMap(data) {
this.mapOption = this.getOptions(data)
this.myChart.setOption(this.mapOption)
this.selectEvent()
this.myChart.dispatchAction({
type: 'showTip',
seriesIndex: 0,
dataIndex: 0
})
// 取消高亮指定的数据图形
this.myChart.dispatchAction({
type: 'downplay',
seriesIndex: 0,
dataIndex: 0
})
this.myChart.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: 0
})
},
selectEvent() {
const myChart = this.myChart
this.myChart.on('click', function(e) {
myChart.dispatchAction({
type: 'downplay',
seriesIndex: 0
})
myChart.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: e.dataIndex
})
myChart.dispatchAction({
type: 'showTip',
seriesIndex: 1,
dataIndex: e.dataIndex
})
})
this.myChart.on('mousemove', function(e) {
myChart.dispatchAction({
type: 'downplay',
seriesIndex: 0
})
myChart.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: e.dataIndex
})
myChart.dispatchAction({
type: 'showTip',
seriesIndex: 1,
dataIndex: e.dataIndex
})
})
this.myChart.on('mouseout', function (e) {
console.log(e)
myChart.dispatchAction({
type: 'downplay',
seriesIndex: 0
})
myChart.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: e.dataIndex
})
myChart.dispatchAction({
type: 'showTip',
seriesIndex: 1,
dataIndex: e.dataIndex
})
})
},
chartBindEvent() {
// resize
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!