Bug description
If you create a pie chart with metric being count, it formats the count adaptively, incorrectly as a percentage.
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
- [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
Hi @steele-boolkin-naked! I'm Dosu and I’m helping the superset team.
This is a known issue: Superset's pie chart labels and tooltips can format count metrics as percentages, resulting in values like "2496.00%" when the metric is a raw count. The label formatting logic in the codebase does not distinguish between count and percentage metrics—if you select a label type that includes percent, it will always show a percentage, even for counts. There isn't a built-in way to suppress this behavior for count metrics, and recent updates haven't addressed this bug yet [source].
You can partially work around this by customizing the label type in the chart control panel (e.g., choose "Value" or "Category and Value" instead of any option that includes "Percent"), or by using the "Template" option to format labels with only the variables you want. For tooltips, you can also modify the formatter function in transformProps.ts to control what is displayed [source]. However, these workarounds do not fully prevent percentage formatting for count metrics.
If you need to avoid percentage formatting entirely for count metrics, you may need to adjust the chart configuration or customize the frontend code. There is no official fix or configuration option for this yet.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Comment From: SBIN2010
What version are you using? More like "count 24 96%" where the spaces in the tooltip are missing. This bug was fixed in #34018
Comment From: msyavuz
@steele-boolkin-naked yeah, this should be fixed on master.
Comment From: sfirke
Boo - I tried to close this as a duplicate of #34198 not #3419 .