【update】-wp29大屏报价
This commit is contained in:
@@ -65,7 +65,7 @@ export default {
|
||||
let dataStr = ''
|
||||
let index = params[0].dataIndex
|
||||
const showLabelName = xAxisDataName[index]
|
||||
|
||||
dataStr += ` <div style="color:#333;margin-left: 8px;font-size: 14px">${showLabelName} </div>`
|
||||
params.forEach(item => {
|
||||
let color = ''
|
||||
if(typeof item.color === 'string') {
|
||||
@@ -74,9 +74,9 @@ export default {
|
||||
color = item.color.colorStops[0].color
|
||||
}
|
||||
dataStr += `<div>
|
||||
<div style="margin: 0 8px;">
|
||||
<div style="margin: 0 8px;">
|
||||
<span style="display:inline-block;margin-right:5px;width:15px;height:10px;background-color:${color};border-radius: 3px"></span>
|
||||
<span style="color:#666;white-space: pre-wrap;word-break: break-all">${showLabelName}</span>
|
||||
<span style="color:#666">${item.seriesName}</span>
|
||||
<span style="color:#333;">${item.value}</span>
|
||||
</div>
|
||||
</div>`
|
||||
@@ -90,7 +90,7 @@ export default {
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '',
|
||||
name: '总数',
|
||||
type: 'bar',
|
||||
barMaxWidth:20,
|
||||
itemStyle:{
|
||||
|
||||
@@ -197,7 +197,7 @@ export default {
|
||||
tippy(data.el, {
|
||||
content:
|
||||
'<div class="tippy-content-box-new" style="">' +
|
||||
'<span style="margin-right: 10px;" class="text-index">' + content[0].orgType + '</span>' + '<span class="text-index">' + content[0].name + '</span>' +
|
||||
'<span class="text-index">' + content[0].name + '</span>' +
|
||||
'<div class="tippy-content">技术领域: ' + content[0].type + '</div>' + '' +
|
||||
'<div class="tippy-content">时间: ' + content[0].timeAll + '</div>' + '' +
|
||||
'<div class="tippy-content">地点: ' + content[0].place + '</div>' +
|
||||
|
||||
@@ -47,10 +47,12 @@ export default {
|
||||
this.xAxisData = arr[0].xaxis
|
||||
this.xAxisDataName = arr[0].departNameCnList
|
||||
this.yData = []
|
||||
this.yDataArr = []
|
||||
this.legendData = []
|
||||
arr.map(tt => {
|
||||
this.yData.push(tt.data || [])
|
||||
this.legendData.push(tt.name)
|
||||
this.yDataArr = tt.totalOneList
|
||||
})
|
||||
},
|
||||
// 初始化图表
|
||||
@@ -67,32 +69,30 @@ export default {
|
||||
},
|
||||
tooltip: {
|
||||
formatter: params => {
|
||||
console.log("---params---------", params)
|
||||
// 获取xAxis data中的数据
|
||||
let dataStr = ''
|
||||
let total = 0
|
||||
for (let i = 0; i < params.length; i++) {
|
||||
total += parseInt(params[i].data)
|
||||
}
|
||||
// let total = 0
|
||||
// for (let i = 0; i < params.length; i++) {
|
||||
// total += parseInt(params[i].data)
|
||||
// }
|
||||
let index = params[0].dataIndex
|
||||
const showLabelName = this.xAxisDataName[index]
|
||||
dataStr += ` <div style="color:#333;margin-left: 8px;font-size: 14px">${showLabelName} 总数: ${total}</div>`
|
||||
|
||||
// params.forEach(item => {
|
||||
// let color = ''
|
||||
// if(typeof item.color === 'string') {
|
||||
// color = item.color
|
||||
// } else {
|
||||
// color = item.color.colorStops[0].color
|
||||
// }
|
||||
// dataStr += `<div>
|
||||
// <div style="margin: 0 8px;">
|
||||
// <span style="display:inline-block;margin-right:5px;width:15px;height:10px;background-color:${color};border-radius: 3px"></span>
|
||||
// <span style="color:#666">${item.seriesName}</span>
|
||||
// <span style="color:#333;">${item.value}</span>
|
||||
// </div>
|
||||
// </div>`
|
||||
// })
|
||||
dataStr += ` <div style="color:#333;margin-left: 8px;font-size: 14px">${showLabelName} </div>`
|
||||
params.forEach(item => {
|
||||
let color = ''
|
||||
if(typeof item.color === 'string') {
|
||||
color = item.color
|
||||
} else {
|
||||
color = item.color.colorStops[0].color
|
||||
}
|
||||
dataStr += `<div>
|
||||
<div style="margin: 0 8px;">
|
||||
<span style="display:inline-block;margin-right:5px;width:15px;height:10px;background-color:${color};border-radius: 3px"></span>
|
||||
<span style="color:#666">${item.seriesName}</span>
|
||||
<span style="color:#333;">${item.value}</span>
|
||||
</div>
|
||||
</div>`
|
||||
})
|
||||
return dataStr
|
||||
}
|
||||
},
|
||||
@@ -100,35 +100,45 @@ export default {
|
||||
data: this.xAxisData
|
||||
},
|
||||
series: [
|
||||
// {
|
||||
// name: this.legendData[0],
|
||||
// type: 'bar',
|
||||
// stack: 'total',
|
||||
// barMaxWidth:20,
|
||||
// itemStyle:{
|
||||
// borderRadius:[0,0,0,0],
|
||||
// },
|
||||
// data: this.yData[0]
|
||||
// },
|
||||
// {
|
||||
// name: this.legendData[1],
|
||||
// type: 'bar',
|
||||
// stack: 'total',
|
||||
// barMaxWidth:20,
|
||||
// itemStyle:{
|
||||
// borderRadius:[0,0,0,0],
|
||||
// },
|
||||
// data: this.yData[1]
|
||||
// },
|
||||
// {
|
||||
// name: this.legendData[2],
|
||||
// type: 'bar',
|
||||
// stack: 'total',
|
||||
// barMaxWidth:20,
|
||||
// itemStyle:{
|
||||
// borderRadius:[4,4,0,0],
|
||||
// },
|
||||
// data: this.yData[2]
|
||||
// },
|
||||
{
|
||||
name: this.legendData[0],
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
barMaxWidth:20,
|
||||
itemStyle:{
|
||||
borderRadius:[0,0,0,0],
|
||||
},
|
||||
data: this.yData[0]
|
||||
},
|
||||
{
|
||||
name: this.legendData[1],
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
barMaxWidth:20,
|
||||
itemStyle:{
|
||||
borderRadius:[0,0,0,0],
|
||||
},
|
||||
data: this.yData[1]
|
||||
},
|
||||
{
|
||||
name: this.legendData[2],
|
||||
name: '总数',
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
barMaxWidth:20,
|
||||
itemStyle:{
|
||||
borderRadius:[4,4,0,0],
|
||||
},
|
||||
data: this.yData[2]
|
||||
data: this.yDataArr
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user