Screenshot
in superset v5.0 :
in supervet v4.x it was :
Description
On pie chart, tooltip displays a concatenation of "total" (13 in my example) + "percentage" (59.09%) which is not readable/understandable
Comment From: dosubot[bot]
Hi @maximedemarey-wb! I'm Dosu and I’m helping the superset team.
The tooltip content for Pie Charts in Superset v4.x is controlled by the "Label Type" and "Label Template" options in the chart's control panel. The unreadable concatenation of total and percentage is likely due to the current label_type
setting. To improve readability, try setting "Label Type" to "Category, Value and Percentage" for a format like Name: Value (Percentage)
, which matches the clearer style from previous versions. For even more control, use the "Template" option and customize the tooltip with variables like {name}
, {value}
, and {percent}
cite.
If the "Total" label is also cluttering the chart, you can disable it by unchecking the "Show Total" option in the control panel cite.
These settings should help you achieve a more readable tooltip. If the issue persists, it may be related to specific chart settings or data, so experimenting with different configurations can help pinpoint the cause.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Comment From: kkkasio
i have same issue, How disable percent "count" option and show total?
wtf is 5842.33%
my dataset:
my metric: count(curso.tipo_id)
Comment From: fawadinam
I am facing a similar issue, it does seem to work fine on Sunburst chart but not in the Pie chart. I want to customise the value its showing on the tooltip instead of the default value, also the value and percentages are concatenated.
I also tried making following change
tooltip: {
show: false,
in "const echartOptions: EChartsCoreOption = {" within file transformProps.ts but it didn't seem to work at all. If i am not able to fix it, then it should be hidden atleast.
Comment From: fawadinam
I am facing a similar issue, it does seem to work fine on Sunburst chart but not in the Pie chart. I want to customise the value its showing on the tooltip instead of the default value, also the value and percentages are concatenated. I also tried making following change tooltip: { show: false, in "const echartOptions: EChartsCoreOption = {" within file transformProps.ts but it didn't seem to work at all. If i am not able to fix it, then it should be hidden atleast.
So what I have done is change the return method for Tooltip in TransformProps.ts. so instead of using tooltipHtml i'm returning the actual arguments here. Following is how it looks now.
current code: formatter: (params: any) => { const [name, formattedValue, formattedPercent] = parseParams({ params, numberFormatter, sanitizeName: true, }); return tooltipHtml( [[metricLabel, formattedValue, formattedPercent]], name, );
changed code:
formatter: (params: any) => {
const [name, formattedValue, formattedPercent] = parseParams({
params,
numberFormatter,
sanitizeName: true,
});
return `${name} ${formattedValue}, ${formattedPercent}`;
Comment From: rusackas
@fawadinam would you be willing to open a PR with those changes so we can check it out? Contributions are always welcome, obviously!
CC @michael-s-molina who worked on these tooltips, and may have an alternate approach.
Comment From: rusackas
I do believe this was resolved by https://github.com/apache/superset/pull/34018, but if I'm mistaken, say the word and we'll close it out!