TimeSeries: Fix shared cursor (#39738)

This commit is contained in:
Zoltán Bedi 2021-09-29 10:27:04 +02:00 committed by GitHub
parent a17244e522
commit 4682cf5b7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,7 +72,7 @@ export interface GraphNGState {
}
/**
* "Time as X" core component, expectes ascending x
* "Time as X" core component, expects ascending x
*/
export class GraphNG extends React.Component<GraphNGProps, GraphNGState> {
static contextType = PanelContextRoot;
@ -138,7 +138,7 @@ export class GraphNG extends React.Component<GraphNGProps, GraphNGState> {
const u = this.plotInstance.current;
if (u) {
// Try finding left position on time axis
const left = u.valToPos(evt.payload.point.time, 'time');
const left = u.valToPos(evt.payload.point.time, 'x');
let top;
if (left) {
// find midpoint between points at current idx