mirror of
https://github.com/dataease/dataease.git
synced 2026-05-23 13:58:26 +08:00
style(图表): 桑基图提示占比的显示优化
This commit is contained in:
committed by
jianneng-fit2cloud
parent
d868fdfd83
commit
af826bb872
@@ -195,12 +195,11 @@ export class SankeyBar extends G2PlotChartView<SankeyOptions, Sankey> {
|
||||
const { source, target, value } = datum
|
||||
// 总出占比
|
||||
if (t.tooltipFormatter.showTotalPercent) {
|
||||
const decimalCount =
|
||||
t.tooltipFormatter.type !== 'auto' ? t.tooltipFormatter.decimalCount : 2
|
||||
const ratio = (value / outTotal[source]).toFixed(decimalCount)
|
||||
const { decimalCount = 2 } = t.tooltipFormatter
|
||||
const ratioStr = ((value / outTotal[source]) * 100).toFixed(decimalCount) + '%'
|
||||
return {
|
||||
name: source + ' -> ' + target,
|
||||
value: valueFormatter(value, t.tooltipFormatter) + ` (${ratio}%)`
|
||||
name: `${source} -> ${target}`,
|
||||
value: valueFormatter(value, t.tooltipFormatter) + ` (${ratioStr})`
|
||||
}
|
||||
}
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user