Bug description

Image

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  Chat with Dosu Join Discord Share on X