Commit a4157902 by 胡悦

修复

1 parent 25065fe5
......@@ -141,7 +141,7 @@ export default {
this.getOverallbase('wechatGroup')
this.getOverallbase('applet')
this.getOverallbase('publiccus')
this.getOveralltrend('total')
this.getOveralltrend(this.tabType)
},
changeType(type) {
let title = {
......@@ -348,6 +348,9 @@ export default {
}
this.canvas.setOption(options)
this.chartAction(lineData)
this.canvas.on('globalout', () => {
this.chartAction(lineData)
})
window.addEventListener('resize', () => {
this.canvas.resize()
})
......
......@@ -63,6 +63,7 @@ export default {
this.option = {
tooltip: {
trigger: 'axis',
showContent: false,
axisPointer: {
type: 'shadow',
shadowStyle: {
......@@ -142,12 +143,22 @@ export default {
this.barChart.clear()
this.barChart.setOption(this.option)
this.chartAction()
// 鼠标划入
this.barChart.on('mouseover', data => {
this.initPieData(data.name)
console.log(data)
this.currentData = data
this.barChart.getZr().on('mousemove', params => {
const pointInPixel = [params.offsetX, params.offsetY]
const pointInGrid = this.barChart.convertFromPixel({ seriesIndex: 0 }, pointInPixel)
const yIndex = pointInGrid[1]
const op = this.barChart.getOption()
const name = op.yAxis[0].data[yIndex]
this.initPieData(name)
this.currentData = {
name,
dataIndex: yIndex
}
})
// 鼠标划入
// this.barChart.on('mouseup', data => {
// this.initPieData(data.name)
// })
this.barChart.on('globalout', () => {
this.chartAction(this.currentData.dataIndex)
this.initPieData(this.currentData.name)
......
......@@ -166,7 +166,7 @@ export default {
minSize: '30%',
maxSize: '100%',
sort: 'descending',
gap: 2,
gap: 1,
label: {
show: true,
position: 'inside',
......@@ -194,13 +194,19 @@ export default {
]
}
this.echartsFunnel.setOption(this.option)
// this.echartsFunnel.getZr.on('mouseover', params => {
// })
this.echartsFunnel.on(
'mouseover',
utils.debounce(data => {
console.log(data)
this.getSaleTrans(this.paramsData, data.data.type, data.data.name, data.dataIndex)
}),
1000 / 60
500
)
// this.echartsFunnel.on('globalout', () => {
// })
},
getSaleTrans(val, queryItem = 'enter', name = '客流', index = 0) {
const params = {
......
/*
* @Description:
* @Author: huyue
* @Date: 2022-06-30 10:57:14
* @LastEditors: huyue
* @LastEditTime: 2022-06-30 10:57:17
*/
function getLineOptions(obj) {
const { tooltipFormatter } = obj
var lineOptions = {
tooltip: {
trigger: 'axis',
borderWidth: 0,
backgroundColor: 'rgba(68,68,68,0.80)',
textStyle: {
color: '#FFFFFF',
fontSize: '8px'
},
extraCssText: 'width: 60px;',
formatter: tooltipFormatter || ''
},
grid: {
left: '3%',
right: '4%',
top: '10%',
bottom: '10%',
containLabel: true
},
xAxis: {
type: 'category',
axisLabel: {
color: '#606266',
fontSize: '0.8em'
},
data: []
},
yAxis: {
type: 'value',
splitLine: {
lineStyle: {
color: '#606266'
}
}
},
series: [
{
type: 'line',
itemStyle: {
color: '#F5AA01'
},
// 节点,平滑曲线
symbol: 'none',
smooth: true,
// 折线背景色
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: 'rgba(254, 84, 0, 0.6)'
},
{
offset: 1,
color: 'rgba(254, 84, 0, 0.05)'
}
]
}
},
data: []
}
]
}
return lineOptions
}
export default getLineOptions
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!