Fix cannot brush on bars of vertical bar chart to zoom into data (#94290) (#94302)

Closes: #94248
This commit is contained in:
Alexey Antonov 2021-03-11 09:56:09 +03:00 committed by GitHub
parent 623f43cb8c
commit 088525c003
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)];