File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
core/core-frontend/src/views/chart/components/js/panel/charts/others Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -195,12 +195,11 @@ export class SankeyBar extends G2PlotChartView<SankeyOptions, Sankey> {
195
195
const { source, target, value } = datum
196
196
// 总出占比
197
197
if ( t . tooltipFormatter . showTotalPercent ) {
198
- const decimalCount =
199
- t . tooltipFormatter . type !== 'auto' ? t . tooltipFormatter . decimalCount : 2
200
- const ratio = ( value / outTotal [ source ] ) . toFixed ( decimalCount )
198
+ const { decimalCount = 2 } = t . tooltipFormatter
199
+ const ratioStr = ( ( value / outTotal [ source ] ) * 100 ) . toFixed ( decimalCount ) + '%'
201
200
return {
202
- name : source + ' -> ' + target ,
203
- value : valueFormatter ( value , t . tooltipFormatter ) + ` (${ ratio } % )`
201
+ name : ` ${ source } -> ${ target } ` ,
202
+ value : valueFormatter ( value , t . tooltipFormatter ) + ` (${ ratioStr } )`
204
203
}
205
204
}
206
205
return {
You can’t perform that action at this time.
0 commit comments