FormidableLabs / FormidableLabs/victory

VictoryVoronoiContainer with VictoryBar inside VictoryGroup gives inconsistent grouping in tooltip depending on bar values

Open
#2,847 6 comments 0 reactions 0 assignees View on GitHub
Issue: Accepted Type: Bug :bug:
Dominant language
TypeScript
Stars
11.2k
Forks
536
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

### Victory version

36.6.8

### Code Sandbox link

https://codesandbox.io/p/sandbox/victory-starter-forked-xczy4h?file=%2Fsrc%2FApp.tsx

### Bug report
I've been trying to workaround this but to no avail so I'm reaching out for an improvement request or help.

```markdown
My end goal is to have consistent tooltip on grouped bar graph like below:
Surely a new boolean prop to dictate the tooltip grouping behavior could resolve this.
```
![frame graph grouped tooltip](https://github.com/FormidableLabs/victory/assets/1154566/c322dc0f-880e-4f09-90b3-a2873c33521a)

### Steps to reproduce

```markdown
Check the sandbox.
Hover over the various bars.
Having VictoryBar inside VictoryGroup.
Some bars with the same value within a group
Some bars with all distinct values within a group.
The tooltip behavior is inconsistent.
```

### Expected behavior

```markdown
When hovering over a group of bar, having a consistent grouping behavior.
Maybe always show a single tooltip even if repeated values are found.
Like this we can build up our own grouped tooltip with the commented code in my sandbox or keep the behavior of a single bar per tooltip.
```

### Actual behavior

```markdown
When bars in a group have the same value, they get grouped in the same tooltip.
When a bar value is unique in the group, it prints a single element tooltip.
This cause inconsistent behavior that's impossible to customize.
```

![victory bug tooltip 1](https://github.com/FormidableLabs/victory/assets/1154566/f8472e2d-2477-4c17-b431-82aec94f964c)
![victory bug tooltip 2](https://github.com/FormidableLabs/victory/assets/1154566/f3da5059-83ac-4bfd-80a3-08df203233bd)
![victory bug tooltip 3](https://github.com/FormidableLabs/victory/assets/1154566/e7609b5f-a91c-4e01-80cb-2217c755c9c7)
![victory bug tooltip 4](https://github.com/FormidableLabs/victory/assets/1154566/0797899c-185b-4c7b-bd9a-6932c840fe50)

### Environment

```markdown
It's a nice sunny spring day outside, 49°F
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.