amaannawab923 commented on code in PR #33559:
URL: https://github.com/apache/superset/pull/33559#discussion_r2102279289
##########
superset-frontend/plugins/plugin-chart-echarts/src/Radar/transformProps.ts:
##########
@@ -259,6 +330,33 @@ export default function transformProps(
},
];
+ const NormalisedTooltipFormaterr = function (params: any) {
+ const { color } = params;
+ const seriesName = params.name || '';
+ const values = params.value;
+
+ const colorDot = `<span
style="display:inline-block;margin-right:5px;border-radius:50%;width:5px;height:5px;background-color:${color}"></span>`;
+
+ // Start with series name without dot
+ let tooltip = `<div
style="font-weight:bold;margin-bottom:5px;">${seriesName || 'series0'}</div>`;
+
+ metricLabels.forEach((metric, index) => {
+ const normalizedValue = values[index];
+ const originalValue = getDenormalisedSeriesValue(
+ seriesName,
+ String(normalizedValue),
+ );
+ tooltip += `
+ <div style="display:flex;">
+ <div>${colorDot}${metric}:</div>
+ <div
style="font-weight:bold;margin-left:auto;">${originalValue}</div>
+ </div>
+ `;
+ });
Review Comment:
Since we need to override the denormalised values with the normalised values
in tooltip we create the tooltip from scratch with the tooltip formatter in the
format that echarts expect which is html string
--
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]