优化历史增量数据显示效果

This commit is contained in:
ngfchl
2022-12-26 22:27:06 +08:00
parent fbf847f8bc
commit 417a0bd3b5

View File

@@ -694,10 +694,13 @@
// console.log(params[0].value[1])
let text = ''
let total = 0
params.sort((a, b) => {
return b.value - a.value
})
params.forEach((param, index) => {
let temp = param.value == 0 ? '' : `
<div style="display: block;height:20px;width: 48%;float:left;padding: 1%;font-size: 12px;">
<span style="float:left;"><i style="width: 10px;height: 10px;display: inline-block;background: ${param.color};border-radius: 10px;"></i>${param.seriesName}: </span>
<div style="display: block;height:14px;width: 48%;float:left;padding: 1%;font-size: 10px;">
<span style="float:left;"><i style="width: 8px;height: 8px;display: inline-block;background: ${param.color};border-radius: 8px;"></i>${param.seriesName}: </span>
<span style="float:right;">${renderSize(param.value)}</span>
</div>
`
@@ -705,20 +708,28 @@
total += param.value
})
let total_str = `
<div style="display: block;height:20px;width: 50%;text-align: left;padding: 2%;">
<div style="display: block;height:14px;text-align: left;padding: 1%;font-size: 12px;">
<span style="float: left;">
<i style="width: 10px;height: 10px;display: inline-block;background: darkorange;border-radius: 10px;">
</i>${params[0].axisValue}
${renderSize(total)}</span>
<i style="width: 8px;height: 8px;display: inline-block;background: darkorange;border-radius: 8px;">
</i>总计:${renderSize(total)}</span>
<text style="float: right;">${params[0].axisValue}</text>
</div>
<hr>
`
total_str += text
return `<div style="width: 300px;">${total_str}</div>`
return `<div style="width: 250px;">${total_str}</div>`
},
position: function (point, params, dom, rect, size) {
// console.log(point)
return [point[1], 8]
let customVH = window.innerWidth
if (customVH - point[0] < 250) {
point[0] = customVH - 300
}
console.log(customVH)
console.log(point[0])
if (customVH > 768) {
return point
}
return [point[0], 5]
},
order: 'valueDesc',
confine: false,