Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VictoryBoxPlot does not show label tooltips #2621

Open
harrisonlo opened this issue Jun 16, 2023 · 6 comments
Open

VictoryBoxPlot does not show label tooltips #2621

harrisonlo opened this issue Jun 16, 2023 · 6 comments
Labels
Issue: Accepted The submitted issue has been confirmed by the Victory core team Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release

Comments

@harrisonlo
Copy link

Describe the bug
The labelComponent prop does not seem to have an effect on VictoryBoxPlot, unlike the pattern in other charts such as VictoryPie or VictoryBar. Passing VictoryTooltip in would not show a tooltip on hover.

Victory version
36.6.10

Code Sandbox link
https://codesandbox.io/s/victory-boxplot-tooltip-issue-33tmtt

To Reproduce
Steps to reproduce the behavior:

  1. Open sandbox
  2. Hover around VictoryBoxPlot
  3. Hover around VictoryBar to see tooltips

Expected behavior
VictoryBoxPlot with a VictoryTooltip component in the labelComponent prop would show a tooltip on hover

@troynguyen8
Copy link

I'm having a lot of difficulty with this too. Does anyone have a workaround, or is there any update?

@carbonrobot carbonrobot added Type: Bug 🐛 Oh no! A bug or unintentional behavior Issue: Accepted The submitted issue has been confirmed by the Victory core team labels Feb 22, 2024
@carbonrobot
Copy link
Contributor

carbonrobot commented Feb 22, 2024

The VictoryBoxPlot does not have a labelComponent property, but instead has specific labels depending on the type of data you want to display. These additional label properties do not yet support the Tooltip, only labelComponent currently does.

API Reference: https://commerce.nearform.com/open-source/victory/docs/victory-box-plot

@carbonrobot carbonrobot added Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release and removed Type: Bug 🐛 Oh no! A bug or unintentional behavior labels Feb 22, 2024
@Burnett2k
Copy link
Member

Hi there @harrisonlo and @troynguyen8 . I'm currently researching this issue. Appreciate the reproduction example. After reviewing the code, I can definitely say Victory does not currently support usage of labelComponent within VictoryBoxPlot. It appears this was intentional because boxPlots use different data structures than our other charts. Things such as median, min and max which don't currently work with VictoryTooltip.

Do you mind sharing a bit more about your use case here? We do provide specific labelComponents for max, median, and min labelcomponents (Ex: here) which do work as labels, but not as tooltips.

I will have to discuss with the team, but it seems to keep this specific BoxPlot api working, it might be preferable to add support for tooltips in each of those labelComponents, rather than adding a new generic labelComponent. Would that work for you?

If you could provide more about what type of tooltip behavior you want to see that would be helpful, as there are many values associated with each of the box plots.

Finally, I realize the documentation for common props makes it appear that all components support labelComponent, so that's our bad. I will make a note to update the documentation so that point is clearer.

@troynguyen8
Copy link

troynguyen8 commented Feb 22, 2024

Hey @Burnett2k !

it might be preferable to add support for tooltips in each of those labelComponents, rather than adding a new generic labelComponent. Would that work for you?

This would work well for my use case! I'm essentially hoping for a press (I'm using Victory Native) on anywhere in the boxplot to show the stats in detail view. Within the tooltip could be something like

Full qualitative X axis name
min: 0
q1: 10
median: 15
q3: 20
max: 25

In an ideal world this tooltip would always point toward the median of the boxplot, but it would not be a deal breaker if I had to pass tooltip to each of the 5 stats and they'd point to the whisker/box lines all with the same content

@chriszrc
Copy link

chriszrc commented May 28, 2024

I was really expecting that at a minimum, supplying the tooltip to the specific labels:

maxLabelComponent={<VictoryTooltip />}

would work, but it doesn't 😥. My boxplots look a bit busy with all the labels, I think my users expect to hover for values, just like stacked bar charts or anything else:

Screenshot 2024-05-28 at 4 34 43 PM

Is there any way to work around this at the moment?

@carbonrobot
Copy link
Contributor

@chriszrc Agreed, I think I was surprised its not supported as well! I have it up at the top of our features list, but currently no one available to tackle it. I don't have any easy workarounds atm, unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Accepted The submitted issue has been confirmed by the Victory core team Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release
Projects
None yet
Development

No branches or pull requests

5 participants