diff --git a/frontend/src/lib/uPlotLib/plugins/onClickPlugin.ts b/frontend/src/lib/uPlotLib/plugins/onClickPlugin.ts index 56a6f1e333..7dfbbe9b47 100644 --- a/frontend/src/lib/uPlotLib/plugins/onClickPlugin.ts +++ b/frontend/src/lib/uPlotLib/plugins/onClickPlugin.ts @@ -18,8 +18,9 @@ function onClickPlugin(opts: OnClickPluginOpts): uPlot.Plugin { const mouseY = event.offsetY + 40; // Convert pixel positions to data values - const xValue = u.posToVal(mouseX, 'x'); - const yValue = u.posToVal(mouseY, 'y'); + // do not use mouseX and mouseY here as it offsets the timestamp as well + const xValue = u.posToVal(event.offsetX, 'x'); + const yValue = u.posToVal(event.offsetY, 'y'); opts.onClick(xValue, yValue, mouseX, mouseY); };