NEZ-1328 fix: line-chart 数值为null时不显示tooltip
This commit is contained in:
@@ -924,6 +924,7 @@ export default {
|
||||
formatter: function (params) {
|
||||
let str = '<div>'
|
||||
let sum = 0
|
||||
let showFlag = false
|
||||
params.forEach((item, i) => {
|
||||
const tip = legend[item.seriesIndex]
|
||||
const color = self.bgColorList[item.seriesIndex]
|
||||
@@ -934,6 +935,10 @@ export default {
|
||||
[tData.getHours(), tData.getMinutes(), tData.getSeconds()].join(':')
|
||||
str += '<br/>'
|
||||
}
|
||||
showFlag = showFlag || item.data[1]
|
||||
if (isNaN(item.data[1] + '')) {
|
||||
return
|
||||
}
|
||||
const val = formatScientificNotation(item.data[1], 2)
|
||||
sum += isNaN(self.numberWithEConvent(val)) ? 0 : Number(self.numberWithEConvent(val))
|
||||
str += '<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">'
|
||||
@@ -960,7 +965,11 @@ export default {
|
||||
str += '</div>'
|
||||
}
|
||||
str += '</div>'
|
||||
return str
|
||||
if (!showFlag) {
|
||||
return ''
|
||||
} else {
|
||||
return str
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
|
||||
Reference in New Issue
Block a user