-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Labels
:dataData/series/scales related issueData/series/scales related issue:tooltipRelated to hover tooltipRelated to hover tooltip:xyBar/Line/Area chart relatedBar/Line/Area chart relatedbugSomething isn't workingSomething isn't working
Description
Describe the issue
Rendering a chart with a minInterval of 1ms creates an issue in the tooltip: the tooltip jumps to the closest bar when you are with your mouse 1 bar before the actual highlighted bar.
This is caused by the check here where the difference computed between the currentValue and the inverted value is exactly 1 as the min interval. I'm not sure if this is even visible with other values.
| const withinBandwidth = invertedValue - currentValue <= this.minInterval; |
To Reproduce
Steps to reproduce the behavior:
- Go to the storybook, and create a chart with the following config:
<Settings
debug={boolean('debug', false)}
baseTheme={useBaseTheme()}
xDomain={{
min: new Date('2025-10-27T14:32:00.622Z').valueOf(),
max: new Date('2025-10-27T14:32:00.650Z').valueOf(),
minInterval: 1,
}}
/>
<Axis
id="bottom"
position={Position.Bottom}
title="Bottom axis"
showOverlappingTicks={boolean('showOverlappingTicks bottom axis', false)}
showOverlappingLabels={boolean('showOverlappingLabels bottom axis', false)}
tickFormat={formatter}
/>
<Axis id="left2" title="Left axis" position={Position.Left} tickFormat={(d: any) => Number(d).toFixed(2)} />
<BarSeries
id="bars"
xScaleType={ScaleType.Time}
yScaleType={ScaleType.Linear}
xAccessor="key"
yAccessors={['doc_count']}
data={[
{
key_as_string: '2025-10-27T15:32:00.630+01:00',
key: 1761575520630,
doc_count: 23,
},
{
key_as_string: '2025-10-27T15:32:00.632+01:00',
key: 1761575520632,
doc_count: 1,
},
{
key_as_string: '2025-10-27T15:32:00.637+01:00',
key: 1761575520637,
doc_count: 1,
},
]}
/>- Move your mouse over the cahrt
Expected behaviour
There should be no jump between highlighted intervals.
Screenshots
Version (please complete the following information):
- Elastic Charts: main
nickofthyme
Metadata
Metadata
Assignees
Labels
:dataData/series/scales related issueData/series/scales related issue:tooltipRelated to hover tooltipRelated to hover tooltip:xyBar/Line/Area chart relatedBar/Line/Area chart relatedbugSomething isn't workingSomething isn't working
