From 3b34f9b9910efe498f8f8d1ded9196d82d16c7b9 Mon Sep 17 00:00:00 2001 From: Marco Vettorello Date: Mon, 7 Jun 2021 10:37:24 +0200 Subject: [PATCH] fix(type): cast to GeometryValue on ElementClickListener --- .../metrics/inventory_view/components/timeline/timeline.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx index 0a657b5242427..dd1023e7f0185 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx @@ -19,6 +19,7 @@ import { TooltipValue, niceTimeFormatter, ElementClickListener, + GeometryValue, RectAnnotation, RectAnnotationDatum, } from '@elastic/charts'; @@ -141,7 +142,8 @@ export const Timeline: React.FC = ({ interval, yAxisFormatter, isVisible const onClickPoint: ElementClickListener = useCallback( ([[geometryValue]]) => { if (!Array.isArray(geometryValue)) { - const { x: timestamp } = geometryValue; + // casting to GeometryValue as we are using cartesian charts + const { x: timestamp } = geometryValue as GeometryValue; jumpToTime(timestamp); stopAutoReload(); }