Skip to content

Commit

Permalink
[APM] Use asPercent to format breakdown chart
Browse files Browse the repository at this point in the history
Replaces formatters from infra plugin with APM-native `asPercent` formatter. Importing code from `infra/public` breaks when infra is not available.
  • Loading branch information
dgieselaar committed Jun 17, 2020
1 parent 88eed98 commit cb387b1
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
EuiIcon,
} from '@elastic/eui';
import styled from 'styled-components';
import { FORMATTERS, InfraFormatterType } from '../../../../../infra/public';
import { asPercent } from '../../../utils/formatters';

interface TransactionBreakdownKpi {
name: string;
Expand Down Expand Up @@ -65,9 +65,7 @@ const TransactionBreakdownKpiList: React.FC<Props> = ({ kpis }) => {
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiTitle size="s">
<span>
{FORMATTERS[InfraFormatterType.percent](kpi.percentage)}
</span>
<span>{asPercent(kpi.percentage, 1)}</span>
</EuiTitle>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down

0 comments on commit cb387b1

Please sign in to comment.