From 50dac663fe50e1f25547f4ddad7e6cc4da063246 Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Wed, 10 Mar 2021 17:43:32 +0300 Subject: [PATCH] Fix cannot brush on bars of vertical bar chart to zoom into data (#94290) Closes: #94248 --- src/plugins/vis_type_vislib/public/vislib/lib/handler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/vis_type_vislib/public/vislib/lib/handler.js b/src/plugins/vis_type_vislib/public/vislib/lib/handler.js index f3201f60007f0..1be6271382b10 100644 --- a/src/plugins/vis_type_vislib/public/vislib/lib/handler.js +++ b/src/plugins/vis_type_vislib/public/vislib/lib/handler.js @@ -83,7 +83,8 @@ export class Handler { return function (eventPayload) { switch (eventType) { case 'brush': - const xRaw = _.get(eventPayload.data, 'series[0].values[0].xRaw'); + const { xRaw } = eventPayload.data.series[0]?.values.find(({ xRaw }) => Boolean(xRaw)); + if (!xRaw) return; // not sure if this is possible? const [start, end] = eventPayload.range; const range = [convertToTimestamp(start), convertToTimestamp(end)];