Skip to content

Issue 841/tooltip toggle bug#191

Merged
StRhys merged 7 commits intomainfrom
issue-841/Tooltip-Toggle-Bug
Mar 28, 2023
Merged

Issue 841/tooltip toggle bug#191
StRhys merged 7 commits intomainfrom
issue-841/Tooltip-Toggle-Bug

Conversation

@StRhys
Copy link
Copy Markdown
Contributor

@StRhys StRhys commented Mar 20, 2023

This ticket is to address multiple issues with the tooltip on charts.
For testing I used this csv. With PFA, value and sex in the data columns.

First being a rounding issue where anything over 1k would be rounded down and only show a couple digits.
Narrowed the issue down to just stacked bar charts and how the float for total was being parsed.
image

Second was when setting series tooltip to 'none' the tooltip would still appear. This was due to 'hovertemplate' overriding 'hoverinfo' , 'hovertemplate' is not only conditionally set.

Third was 'Hoverinfo unit' despite being set not appearing on the tooltip popup. 'hoverInfoUnit' is now pulled into the hover template.
image

@StRhys StRhys self-assigned this Mar 20, 2023
@StRhys StRhys requested review from eldeal and mikeAdamss March 20, 2023 17:12
}

// if interactivity is enabled show hover text over chart
if (chartProps.Interactivity.interactivity === "x+y") {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the "x+y" be a const somewhere, for a certain interactivity type?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed it to a const, but I've swapped it over to not equal "none", just in case in the future we wanted to introduce other interactivity modes.
Examples being "x", "y", "x+y", "x+y+z", "all".
https://plotly.com/javascript/reference/scatter/#scatter-hoverinfo

Copy link
Copy Markdown

@eldeal eldeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the one little question, but looks reasonable for fixing each of the explained problems

@StRhys StRhys merged commit d88d898 into main Mar 28, 2023
@StRhys StRhys deleted the issue-841/Tooltip-Toggle-Bug branch March 28, 2023 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants