Commit 12015a3a by 胡悦

修改价值分析

1 parent 4053f749
...@@ -48,7 +48,8 @@ export default { ...@@ -48,7 +48,8 @@ export default {
barData: [], barData: [],
key: '重要价值', key: '重要价值',
isBrand: false, isBrand: false,
brandName: '' brandName: '',
currentData: {}
} }
}, },
mounted() {}, mounted() {},
...@@ -60,6 +61,20 @@ export default { ...@@ -60,6 +61,20 @@ export default {
this.barChart.resize() this.barChart.resize()
}) })
this.option = { 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: { grid: {
left: '3%', left: '3%',
right: '4%', right: '4%',
...@@ -94,7 +109,7 @@ export default { ...@@ -94,7 +109,7 @@ export default {
// data: [120, 200, 150, 80, 70, 110, 130, 300], // data: [120, 200, 150, 80, 70, 110, 130, 300],
data: this.barData.reverse(), data: this.barData.reverse(),
type: 'bar', type: 'bar',
barWidth: 12, barWidth: 18,
itemStyle: { itemStyle: {
normal: { normal: {
label: { label: {
...@@ -103,7 +118,7 @@ export default { ...@@ -103,7 +118,7 @@ export default {
textStyle: { textStyle: {
fontSize: '12', fontSize: '12',
color: '#fff', color: '#fff',
height: '12', height: '18',
padding: [1, 0, 0, 0] padding: [1, 0, 0, 0]
} }
}, },
...@@ -124,9 +139,16 @@ export default { ...@@ -124,9 +139,16 @@ export default {
} }
this.barChart.clear() this.barChart.clear()
this.barChart.setOption(this.option) this.barChart.setOption(this.option)
this.chartAction()
// 鼠标划入 // 鼠标划入
this.barChart.on('mouseover', data => { this.barChart.on('mouseover', data => {
this.initPieData(data.name) 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() { getValueType() {
...@@ -178,6 +200,13 @@ export default { ...@@ -178,6 +200,13 @@ export default {
this.brandName = newVal.brand.name this.brandName = newVal.brand.name
} }
this.getValueType() 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!