Skip to content

Commit c42b687

Browse files
committed
Improve ping chart axis
1 parent 496152e commit c42b687

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

x-pack/plugins/uptime/public/components/common/charts/duration_line_series_list.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import React from 'react';
8-
import { LineSeries, CurveType } from '@elastic/charts';
8+
import { LineSeries, CurveType, Fit } from '@elastic/charts';
99
import { LocationDurationLine } from '../../../../common/types';
1010
import { convertMicrosecondsToMilliseconds as microsToMillis } from '../../../lib/helper';
1111

@@ -28,6 +28,7 @@ export const DurationLineSeriesList = ({ lines }: Props) => (
2828
yAccessors={[1]}
2929
yScaleToDataExtent={false}
3030
yScaleType="linear"
31+
fit={Fit.Linear}
3132
/>
3233
))}
3334
</>

x-pack/plugins/uptime/public/components/common/charts/ping_histogram.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { EuiTitle, EuiSpacer } from '@elastic/eui';
1717
import { i18n } from '@kbn/i18n';
1818
import React, { useContext } from 'react';
1919
import { FormattedMessage } from '@kbn/i18n/react';
20+
import numeral from '@elastic/numeral';
2021
import moment from 'moment';
2122
import { getChartDateLabel } from '../../../lib/helper';
2223
import { ChartWrapper } from './chart_wrapper';
@@ -144,6 +145,8 @@ export const PingHistogramComponent: React.FC<PingHistogramComponentProps> = ({
144145
defaultMessage: 'Ping Y Axis',
145146
})}
146147
position="left"
148+
tickFormat={(d) => numeral(d).format('0')}
149+
labelFormat={(d) => numeral(d).format('0a')}
147150
title={i18n.translate('xpack.uptime.snapshotHistogram.yAxis.title', {
148151
defaultMessage: 'Pings',
149152
description:

0 commit comments

Comments
 (0)