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

New default behaviour for tooltips during comparisons #1408

Open
philschoefer opened this issue Oct 21, 2022 · 1 comment
Open

New default behaviour for tooltips during comparisons #1408

philschoefer opened this issue Oct 21, 2022 · 1 comment

Comments

@philschoefer
Copy link
Contributor

philschoefer commented Oct 21, 2022

Feature request summary

Currently Polaris Viz renders the series name for tooltip labels. Each of the tooltip rows consists of the name of the series and the corresponding value at that point of the X-Axis.

This works well when comparing e.g. products:

Show Screenshot Screen Shot 2022-10-21 at 10 25 11 AM

Try in Storybook

However, as soon as one series is set to isComparison: true the output is lacking some information:

Show Screenshot Screen Shot 2022-10-21 at 10 21 35 AM

Try in Storybook

What day exactly had that amount of sales? In the tooltip we indicate that we're comparing against previous month data, but we never know what point in the past the displayed value is actually referring to. We also don't show that information in the X-Axis.

Rationale

Many places in the admin have worked around this limitation by creating custom tooltips that display the label of the activeIndex of the comparison data series instead. So instead of April 1-14 and Previous Period it would show the exact date for that specific data point.

Show Web Implementation Examples Screen Shot 2022-10-21 at 10 44 03 AM Screen Shot 2022-10-21 at 10 43 45 AM

Notebooks is about to hit this issue with ShopifyQLV2 introducing the COMPARE TO keyword: https://github.com/Shopify/core-issues/issues/47801

I think we should consider to update Polaris Viz tooltip default behaviour to switch into a different tooltip mode when isComparison is set on a series where the header disappears and instead of showing series names we display the label of the actual data point in the tooltip.

When this is implemented, we could also consider adding in the Trend indicator which is also commonly used where two values are compared against each other in a tooltip and currently needs to be custom implemented in every place we do comparisons in charts.


🌟 Feature requests that are not yet planned will be closed. We then use the issue’s 👍 upvotes to track and set priorities. See the contribution guidelines for more information.

@martingalovic
Copy link

Hey @philschoefer. Is there any update / options for this? Thanks

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

No branches or pull requests

2 participants