Skip to content

Commit

Permalink
[7.x] [Uptime] Improve ping chart axis (#77992) (#78139)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Sep 22, 2020
1 parent 0b17050 commit cca5857
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import React from 'react';
import { LineSeries, CurveType } from '@elastic/charts';
import { LineSeries, CurveType, Fit } from '@elastic/charts';
import { LocationDurationLine } from '../../../../common/types';
import { convertMicrosecondsToMilliseconds as microsToMillis } from '../../../lib/helper';

Expand All @@ -28,6 +28,7 @@ export const DurationLineSeriesList = ({ lines }: Props) => (
yAccessors={[1]}
yScaleToDataExtent={false}
yScaleType="linear"
fit={Fit.Linear}
/>
))}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { EuiTitle, EuiSpacer } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { useContext } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import numeral from '@elastic/numeral';
import moment from 'moment';
import { getChartDateLabel } from '../../../lib/helper';
import { ChartWrapper } from './chart_wrapper';
Expand Down Expand Up @@ -144,6 +145,8 @@ export const PingHistogramComponent: React.FC<PingHistogramComponentProps> = ({
defaultMessage: 'Ping Y Axis',
})}
position="left"
tickFormat={(d) => numeral(d).format('0')}
labelFormat={(d) => numeral(d).format('0a')}
title={i18n.translate('xpack.uptime.snapshotHistogram.yAxis.title', {
defaultMessage: 'Pings',
description:
Expand Down

0 comments on commit cca5857

Please sign in to comment.