[Uptime] Improve ping chart axis (#77992)

This commit is contained in:
Shahzad 2020-09-22 11:06:34 +02:00 committed by GitHub
parent ed7a630710
commit d3dd50520b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -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';
@ -28,6 +28,7 @@ export const DurationLineSeriesList = ({ lines }: Props) => (
yAccessors={[1]}
yScaleToDataExtent={false}
yScaleType="linear"
fit={Fit.Linear}
/>
))}
</>

View file

@ -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';
@ -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: