forked from github/dataease
style(图表-漏斗图): 遇到空值时,计算结果显示横杠 -
This commit is contained in:
parent
4b48efbf88
commit
d0a7f7540e
@ -149,11 +149,14 @@ export class Funnel extends G2PlotChartView<FunnelOptions, G2Funnel> {
|
||||
fontSize: l.fontSize
|
||||
},
|
||||
formatter: datum => {
|
||||
if (!datum['$$conversion$$'][0]) {
|
||||
return `${conversionTagAtt.text ?? ''} -`
|
||||
}
|
||||
const rate = (
|
||||
(datum['$$conversion$$'][1] / datum['$$conversion$$'][0]) *
|
||||
100
|
||||
).toFixed(conversionTagAtt.precision)
|
||||
return `${conversionTagAtt.text ?? ''}${rate}%`
|
||||
return `${conversionTagAtt.text ?? ''} ${rate}%`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user