dosubot[bot] commented on issue #36310:
URL: https://github.com/apache/superset/issues/36310#issuecomment-3586829747

   <!-- Answer -->
   This tooltip formatting issue is a known regression in Superset, caused by a 
frontend XSS filter that stripped whitespace and styles from tooltip HTML, 
resulting in concatenated values like `COUNT(user_rating)5795.00%` instead of 
properly separated values. The fix for this was merged in [PR 
#34018](https://github.com/apache/superset/issues/36043) and is available in 
the latest Superset master branch. If you’re still seeing the issue after 
updating, try a hard refresh or clear your frontend build cache.
   
   For older versions, you can temporarily resolve this by adding custom CSS to 
your dashboard (e.g., `table * { padding: 5px; }`) or by customizing the 
tooltip formatter in the Pie chart’s `transformProps.ts` file. Here’s an 
example of a formatter function that separates the values:
   
   ```javascript
   formatter: (params: any) => {
     const [name, formattedValue, formattedPercent] = parseParams({
       params,
       numberFormatter,
       sanitizeName: true,
     });
     return `${name} ${formattedValue}, ${formattedPercent}`;
   }
   ```
   You can find more details and code references 
[here](https://github.com/apache/superset/issues/33913) and 
[here](https://github.com/apache/superset/issues/34198). This issue also 
affected other chart types, but the same solution applies.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/7a30334a-c900-446f-af04-7abcd965d35c?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/7a30334a-c900-446f-af04-7abcd965d35c?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/7a30334a-c900-446f-af04-7abcd965d35c?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/7a30334a-c900-446f-af04-7abcd965d35c?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/7a30334a-c900-446f-af04-7abcd965d35c?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/7a30334a-c900-446f-af04-7abcd965d35c?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/7a30334a-c900-446f-af04-7abcd965d35c?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20tooltip%20formatting%20issue%20is%20a%20known%20regression%20in%20Superset%2C%20caused%20by%20a%20frontend%20XSS%20filter%20that%20stripped%20whitespace%20and%20styles%20from%20tooltip%20HTML%2C%20resulting%20in%20concatenated%20values%20like%20%60COUNT%28user_rating%295795.00%25%60%20instead%20of%20properly%20separated%20values.%20The%20fix%20for%20this%20was%20merged%20in%20%5BPR%20%2334018%5D%28https%3A//github.com/apache/superset/issues/36043%29%20and%20is%20available%20in%20the%20latest%20Superset%20master%20branch.%20If%20you%E2%80%99re%20still%20seeing%20the%20issue%20after%20updating%2C%20try%20a%20hard%20refresh%20or%20clear%20your%20frontend%20build%20cache.%0A%0AFor%20older%20versions%2C%20you%20can%20temporarily%20resolve%20this%
 
20by%20adding%20custom%20CSS%20to%20your%20dashboard%20%28e.g.%2C%20%60table%20%2A%20%7B%20padding%3A%205px%3B%20%7D%60%29%20or%20by%20customizing%20the%20tooltip%20formatter%20in%20the%20Pie%20chart%E2%80%99s%20%60transformProps.ts%60%20file.%20Here%E2%80%99s%20an%20example%20of%20a%20formatter%20function%20that%20separates%20the%20values%3A%0A%0A%60%60%60javascript%0Aformatter%3A%20%28params%3A%20any%29%20%3D%3E%20%7B%0A%20%20const%20%5Bname%2C%20formattedValue%2C%20formattedPercent%5D%20%3D%20parseParams%28%7B%0A%20%20%20%20params%2C%0A%20%20%20%20numberFormatter%2C%0A%20%20%20%20sanitizeName%3A%20true%2C%0A%20%20%7D%29%3B%0A%20%20return%20%60%24%7Bname%7D%20%24%7BformattedValue%7D%2C%20%24%7BformattedPercent%7D%60%3B%0A%7D%0A%60%60%60%0AYou%20can%20find%20more%20details%20and%20code%20references%20%5Bhere%5D%28https%3A//github.com/apache/superset/issues/33913%29%20and%20%5Bhere%5D%28https%3A//github.com/apache/superset/issues/34198%29.%20This%20issue%20also%20affected%20other%20
 chart%20types%2C%20but%20the%20same%20solution%20applies.)&nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36310)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to