Skip to content

Commit 0f8690a

Browse files
committed
call round util for normalizedValue series label
1 parent ef3c181 commit 0f8690a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/model/mixin/dataFormat.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import {
3636
import GlobalModel from '../Global';
3737
import { TooltipMarkupBlockFragment } from '../../component/tooltip/tooltipMarkup';
3838
import { error, makePrintable } from '../../util/log';
39+
import { round } from '../../util/number';
3940

4041
const DIMENSION_LABEL_REG = /\{@(.+?)\}/g;
4142

@@ -102,8 +103,8 @@ export class DataFormatMixin {
102103
const stackTop = data.get(stackResultDim, dataIndex) as number;
103104
const stackBottom = data.get(stackedOverDim, dataIndex) as number;
104105
if (!isNaN(stackTop) && !isNaN(stackBottom)) {
105-
const fullPercentValue = stackTop - stackBottom;
106-
params.percent = Math.round(fullPercentValue * 100) / 100;
106+
const normalizedValue = stackTop - stackBottom;
107+
params.percent = round(normalizedValue, 2);
107108
}
108109
}
109110
return params;

0 commit comments

Comments
 (0)