Skip to content

Commit

Permalink
Merge pull request #2203 from kazekage605/dev-0.3
Browse files Browse the repository at this point in the history
fix: 🐛 修复透视驱动数据格式设置问题#1697
  • Loading branch information
scottsut authored May 25, 2021
2 parents dc9bd2b + 6660306 commit f57ad5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion webapp/app/containers/Widget/components/Pivot/Cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ILegend } from './Pivot'
import { IDataParamProperty } from '../Workbench/OperatingPanel'
import { DEFAULT_SPLITER } from 'app/globalConstants'
import { decodeMetricName } from 'containers/Widget/components/util'
import { getFormattedValue } from '../Config/Format';

const styles = require('./Pivot.less')

Expand Down Expand Up @@ -113,7 +114,7 @@ export class Cell extends React.PureComponent <ICellProps, ICellState> {
className={styles.cellContent}
style={{...styleColor}}
>
{d[`${m.agg}(${decodedMetricName})`]}
{getFormattedValue(d[`${m.agg}(${decodedMetricName})`], m.format)}
</p>
)
})
Expand Down
4 changes: 2 additions & 2 deletions webapp/app/containers/Widget/components/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ export function getPivotTooltipLabel(
? record.reduce((sum, r) => sum + r[`${mc.agg}(${decodedName})`], 0)
: record[`${mc.agg}(${decodedName})`]
: 0
return `${decodedName}: ${value}`
return `${decodedName}: ${getFormattedValue(value, mc.format)}`
})
.concat(
dimetionColumns.map((dc) => {
Expand All @@ -707,7 +707,7 @@ export function getPivotTooltipLabel(
? record[0][dc]
: record[dc]
: ''
return `${dc}: ${value}`
return `${dc}: ${getFormattedValue(value, dc.format)}`
})
)
.join('<br/>')
Expand Down

0 comments on commit f57ad5f

Please sign in to comment.