reyryan commented on issue #33865:
URL: https://github.com/apache/superset/issues/33865#issuecomment-3066615876
To fix the styling issue of the global tooltip, I have to update the
following file.
`superset-frontend\packages\superset-ui-core\src\utils\html.tsx
`
```
const xssFilter = new FilterXSS({
whiteList: {
...getDefaultWhiteList(),
span: ['style', 'class', 'title'],
div: ['style', 'class'],
a: ['style', 'class', 'href', 'title', 'target'],
img: ['style', 'class', 'src', 'alt', 'title', 'width', 'height'],
tr: ['style'], // <----- Added this line for the table row
td: ['style'], // <----- Added this line for the table cell
// The rest of the code
});
```
<img width="801" height="516" alt="Image"
src="https://github.com/user-attachments/assets/c907954c-81bf-4921-8f8e-8da6a4c32788"
/>
To totally remove the percentage section of the pie chart tooltip, update
the following file.
`superset-frontend\plugins\plugin-chart-echarts\src\Pie\transformProps.ts
`
```
const echartOptions: EChartsCoreOption = {
grid: {
...defaultGrid,
},
tooltip: {
...getDefaultTooltip(refs),
show: !inContextMenu,
trigger: 'item',
formatter: (params: any) => {
// const [name, formattedValue, formattedPercent] = parseParams({
// <--- Before
const [name, formattedValue] = parseParams({
// <--- After
params,
numberFormatter,
sanitizeName: true,
});
return tooltipHtml(
// [[metricLabel, formattedValue, formattedPercent]], // <----
Before
[[metricLabel, formattedValue]], // <---
After
name,
);
},
},
legend: {
// The rest of the code
```
<img width="1333" height="580" alt="Image"
src="https://github.com/user-attachments/assets/d9509ed0-9a40-4102-bd75-6b3abe4483df"
/>
--
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]