Commit a4157902 by 胡悦

修复

1 parent 25065fe5
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
this.getOverallbase('wechatGroup') this.getOverallbase('wechatGroup')
this.getOverallbase('applet') this.getOverallbase('applet')
this.getOverallbase('publiccus') this.getOverallbase('publiccus')
this.getOveralltrend('total') this.getOveralltrend(this.tabType)
}, },
changeType(type) { changeType(type) {
let title = { let title = {
...@@ -348,6 +348,9 @@ export default { ...@@ -348,6 +348,9 @@ export default {
} }
this.canvas.setOption(options) this.canvas.setOption(options)
this.chartAction(lineData) this.chartAction(lineData)
this.canvas.on('globalout', () => {
this.chartAction(lineData)
})
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.canvas.resize() this.canvas.resize()
}) })
......
...@@ -63,6 +63,7 @@ export default { ...@@ -63,6 +63,7 @@ export default {
this.option = { this.option = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
showContent: false,
axisPointer: { axisPointer: {
type: 'shadow', type: 'shadow',
shadowStyle: { shadowStyle: {
...@@ -142,12 +143,22 @@ export default { ...@@ -142,12 +143,22 @@ export default {
this.barChart.clear() this.barChart.clear()
this.barChart.setOption(this.option) this.barChart.setOption(this.option)
this.chartAction() this.chartAction()
// 鼠标划入 this.barChart.getZr().on('mousemove', params => {
this.barChart.on('mouseover', data => { const pointInPixel = [params.offsetX, params.offsetY]
this.initPieData(data.name) const pointInGrid = this.barChart.convertFromPixel({ seriesIndex: 0 }, pointInPixel)
console.log(data) const yIndex = pointInGrid[1]
this.currentData = data 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.barChart.on('globalout', () => {
this.chartAction(this.currentData.dataIndex) this.chartAction(this.currentData.dataIndex)
this.initPieData(this.currentData.name) this.initPieData(this.currentData.name)
......
...@@ -166,7 +166,7 @@ export default { ...@@ -166,7 +166,7 @@ export default {
minSize: '30%', minSize: '30%',
maxSize: '100%', maxSize: '100%',
sort: 'descending', sort: 'descending',
gap: 2, gap: 1,
label: { label: {
show: true, show: true,
position: 'inside', position: 'inside',
...@@ -194,13 +194,19 @@ export default { ...@@ -194,13 +194,19 @@ export default {
] ]
} }
this.echartsFunnel.setOption(this.option) this.echartsFunnel.setOption(this.option)
// this.echartsFunnel.getZr.on('mouseover', params => {
// })
this.echartsFunnel.on( this.echartsFunnel.on(
'mouseover', 'mouseover',
utils.debounce(data => { utils.debounce(data => {
console.log(data)
this.getSaleTrans(this.paramsData, data.data.type, data.data.name, data.dataIndex) 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) { getSaleTrans(val, queryItem = 'enter', name = '客流', index = 0) {
const params = { 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 \ 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!