chartjs / chartjs/Chart.js

Setting Y-Min for bar chart messes with interactions/tooltips

Open
#11,733 2 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
JavaScript
Stars
67.7k
Forks
11.9k
Avg merge
7h 39m
Merged PRs (30d)
5

Description

### Expected behavior

When setting the interaction axis to 'x', intersect false, mode 'nearest' and then setting the y scale min value to 1, I would expect that hovering above the bars on the chart would show a tooltip on each of the bars.

### Current behavior

Hovering over the individual bars does nothing. It's not until your cursor actually intersects the bars that the tooltip appears. If I change the y-min to 0.5, it appears to work normally. Setting it to 0.8 doesn't catch the shorter bars in the example, but does appear to work more like one would expect.

### Reproducible sample

https://codepen.io/Travja/pen/eYoVjNg

### Optional extra steps/info to reproduce

_No response_

### Possible solution

_No response_

### Context

_No response_

### chart.js version

4.4.2

### Browser name and version

Chrome 123.0.6312.105

### Link to your project

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.