Commit 12015a3a by 胡悦

修改价值分析

1 parent 4053f749
......@@ -48,7 +48,8 @@ export default {
barData: [],
key: '重要价值',
isBrand: false,
brandName: ''
brandName: '',
currentData: {}
}
},
mounted() {},
......@@ -60,6 +61,20 @@ export default {
this.barChart.resize()
})
this.option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
// color: '#fff'
},
borderWidth: 0,
backgroundColor: 'rgba(68,68,68,0.80)',
confine: true,
textStyle: {
color: '#FFFFFF',
fontSize: 8
}
},
grid: {
left: '3%',
right: '4%',
......@@ -94,7 +109,7 @@ export default {
// data: [120, 200, 150, 80, 70, 110, 130, 300],
data: this.barData.reverse(),
type: 'bar',
barWidth: 12,
barWidth: 18,
itemStyle: {
normal: {
label: {
......@@ -103,7 +118,7 @@ export default {
textStyle: {
fontSize: '12',
color: '#fff',
height: '12',
height: '18',
padding: [1, 0, 0, 0]
}
},
......@@ -124,9 +139,16 @@ 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.on('globalout', () => {
this.chartAction(this.currentData.dataIndex)
this.initPieData(this.currentData.name)
})
},
getValueType() {
......@@ -178,6 +200,13 @@ export default {
this.brandName = newVal.brand.name
}
this.getValueType()
},
chartAction(index = 7) {
this.barChart.dispatchAction({
type: 'showTip',
seriesIndex: 0,
dataIndex: index
})
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!