chartjs / chartjs/Chart.js

Bug with tooltip for stacked horizontal bar chart

Open
#11,646 1 comment 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

Proper tooltip shown on bar is hovered.

### Current behavior

Seems like areas for tooltips are shifted when bar chart is stacked.
Probably its because of `data.datasets[].stack` property. The bars are stacked, but tooltip areas act like there is no `stack` property.

### Reproducible sample

https://jsfiddle.net/ovagrc80/

### Optional extra steps/info to reproduce

Just try to slide cursor over bars, and see which tooltip is shown

### Possible solution

_No response_

### Context

I have a statistics, what I need to show as a horizontal bar chart. Basically all I need is in sample, but that bug with tooltip confuse me.

Expected chart:
```
A:5; B:9; C: 10
AAAAABBBBC
```

### chart.js version

v4.4.1

### Browser name and version

_No response_

### 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.