diff --git a/webapp/packages/chat-sdk/src/components/ChatMsg/Bar/index.tsx b/webapp/packages/chat-sdk/src/components/ChatMsg/Bar/index.tsx index 839b20a30..fca49dfb7 100644 --- a/webapp/packages/chat-sdk/src/components/ChatMsg/Bar/index.tsx +++ b/webapp/packages/chat-sdk/src/components/ChatMsg/Bar/index.tsx @@ -94,7 +94,7 @@ const BarChart: React.FC = ({ return value === 0 ? 0 : metricField.dataFormatType === 'percent' - ? `${formatByDecimalPlaces(value, metricField.dataFormat?.decimalPlaces || 2)}%` + ? `${formatByDecimalPlaces(metricField.dataFormat?.needMultiply100 ? +value * 100 : value, metricField.dataFormat?.decimalPlaces || 2)}%` : getFormattedValue(value); }, }, @@ -116,7 +116,7 @@ const BarChart: React.FC = ({ : metricField.dataFormatType === 'percent' || metricField.dataFormatType === 'decimal' ? `${formatByDecimalPlaces( - item.value, + metricField.dataFormat?.needMultiply100 ? +item.value * 100 : item.value, metricField.dataFormat?.decimalPlaces || 2 )}${metricField.dataFormatType === 'percent' ? '%' : ''}` : getFormattedValue(item.value) @@ -151,7 +151,7 @@ const BarChart: React.FC = ({ return value === 0 ? 0 : metricField.dataFormatType === 'percent' - ? `${formatByDecimalPlaces(value, metricField.dataFormat?.decimalPlaces || 2)}%` + ? `${formatByDecimalPlaces(metricField.dataFormat?.needMultiply100 ? +value * 100 : value, metricField.dataFormat?.decimalPlaces || 2)}%` : getFormattedValue(value); }, },