-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add tooltip support for Donut Chart #1587
base: main
Are you sure you want to change the base?
Conversation
Chromatic Storybook: https://6062ad4a2d14cd0021539c1b-vkktuqqdiw.chromatic.com/ |
size-limit report 📦
|
@@ -65,6 +71,7 @@ export function DonutChart(props: DonutChartProps) { | |||
legendPosition={legendPosition} | |||
renderInnerValueContent={renderInnerValueContent} | |||
renderLegendContent={renderLegendContent} | |||
renderTooltipContent={tooltipOptions ? renderTooltip : undefined} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, tooltipOptions
is what enables the tooltip and defines its options in the donut chart. I believe we want the tooltip to be an opt-in experience cc @rachelng. But perhaps another prop like showTooltip
would make more sense? Interested to see what others think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the showTooltip
prop. If we decide to go that route, we should add it to all the other components that can render tooltips.
@michaelnesen Tooltips don't show when tabbing through the chart, is that intended? |
@envex Hmm good question, It looks like for all other charts tabbing through data points shows the tooltip. However with the donut chart it's a little different as tabbing through already selects/highlights the legend. I can check with UX to see if they have an opinion. However I'm currently not sure why the tooltip isn't showing up when the active index changes by focus 🤔 But if all other charts have this tooltip behaviour perhaps it makes sense to also have it in the donut chart for consistency donut-chart-tabbing.mp4 |
What does this implement/fix?
Adds tooltip support for
DonutChart
Does this close any currently open issues?
What do the changes look like?
Storybook link
http://localhost:6006/?path=/story/polaris-viz-charts-donutchart--tooltip
Before merging
Check your changes on a variety of browsers and devices.
Update the Changelog's Unreleased section with your changes.
Update relevant documentation, tests, and Storybook.
Make sure you're exporting any new shared Components, Types and Utilities from the top level index file of the package