diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/Charts/PageViewsChart.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/Charts/PageViewsChart.tsx index 934a985dd735..9211504a2dff 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/Charts/PageViewsChart.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/Charts/PageViewsChart.tsx @@ -30,6 +30,7 @@ import { history } from '../../../../utils/history'; import { fromQuery, toQuery } from '../../../shared/Links/url_helpers'; import { ChartWrapper } from '../ChartWrapper'; import { useUiSetting$ } from '../../../../../../../../src/plugins/kibana_react/public'; +import { useUrlParams } from '../../../../hooks/useUrlParams'; interface Props { data?: Array>; @@ -37,7 +38,15 @@ interface Props { } export function PageViewsChart({ data, loading }: Props) { - const formatter = timeFormatter(niceTimeFormatByDay(2)); + const { urlParams } = useUrlParams(); + + const { start, end } = urlParams; + const diffInDays = moment(new Date(end as string)).diff( + moment(new Date(start as string)), + 'day' + ); + + const formatter = timeFormatter(niceTimeFormatByDay(diffInDays > 1 ? 2 : 1)); const onBrushEnd: BrushEndListener = ({ x }) => { if (!x) { @@ -91,18 +100,21 @@ export function PageViewsChart({ data, loading }: Props) { } showLegend onBrushEnd={onBrushEnd} + xDomain={{ + min: new Date(start as string).valueOf(), + max: new Date(end as string).valueOf(), + }} /> numeral(d).format('0.0 a')} + tickFormat={(d) => numeral(d).format('0a')} /> @@ -54,7 +56,7 @@ export function ClientMetrics() { diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx index c7545ff9a276..53f2d5ae238c 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx @@ -102,7 +102,7 @@ export function PageLoadDistribution() { /> - + + diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/translations.ts b/x-pack/plugins/apm/public/components/app/RumDashboard/translations.ts index 96d1b529c52f..66eeaf433d2a 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/translations.ts +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/translations.ts @@ -16,9 +16,6 @@ export const I18LABELS = { pageViews: i18n.translate('xpack.apm.rum.dashboard.pageViews', { defaultMessage: 'Page views', }), - dateTime: i18n.translate('xpack.apm.rum.dashboard.dateTime.label', { - defaultMessage: 'Date / Time', - }), percPageLoaded: i18n.translate('xpack.apm.rum.dashboard.pagesLoaded.label', { defaultMessage: 'Pages loaded', }), diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 411aa3424c85..118362f494b4 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -4909,7 +4909,6 @@ "xpack.apm.registerTransactionDurationAlertType.variables.serviceName": "サービス名", "xpack.apm.registerTransactionDurationAlertType.variables.transactionType": "トランザクションタイプ", "xpack.apm.rum.dashboard.backend": "バックエンド", - "xpack.apm.rum.dashboard.dateTime.label": "日付/時刻", "xpack.apm.rum.dashboard.frontend": "フロントエンド", "xpack.apm.rum.dashboard.overall.label": "全体", "xpack.apm.rum.dashboard.pageLoadDistribution.label": "ページ読み込み分布", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index c46135633a3c..de1f20611844 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -4911,7 +4911,6 @@ "xpack.apm.registerTransactionDurationAlertType.variables.serviceName": "服务名称", "xpack.apm.registerTransactionDurationAlertType.variables.transactionType": "事务类型", "xpack.apm.rum.dashboard.backend": "后端", - "xpack.apm.rum.dashboard.dateTime.label": "日期 / 时间", "xpack.apm.rum.dashboard.frontend": "前端", "xpack.apm.rum.dashboard.overall.label": "总体", "xpack.apm.rum.dashboard.pageLoadDistribution.label": "页面加载分布",