From 9cb9e5beee0ffda72fec7cffaf5930f3ca2b40ff Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Wed, 4 Sep 2024 08:38:43 -0300 Subject: [PATCH] fix: New tooltip inappropriately combines series on mixed chart (#30137) --- .../src/MixedTimeseries/transformProps.ts | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts index 9a6705ee2..c7cf12685 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts @@ -35,7 +35,6 @@ import { isIntervalAnnotationLayer, isPhysicalColumn, isTimeseriesAnnotationLayer, - NumberFormats, QueryFormData, QueryFormMetric, TimeseriesChartDataResponseResult, @@ -92,7 +91,6 @@ import { import { TIMEGRAIN_TO_TIMESTAMP, TIMESERIES_CONSTANTS } from '../constants'; import { getDefaultTooltip } from '../utils/tooltip'; import { - getPercentFormatter, getTooltipTimeFormatter, getXAxisFormatter, getYAxisFormatter, @@ -235,7 +233,6 @@ export default function transformProps( const xAxisDataType = dataTypes?.[xAxisLabel] ?? dataTypes?.[xAxisOrig]; const xAxisType = getAxisType(stack, xAxisForceCategorical, xAxisDataType); const series: SeriesOption[] = []; - const percentFormatter = getPercentFormatter(NumberFormats.PERCENT_2_POINT); const formatter = contributionMode ? getNumberFormatter(',.0%') : currencyFormat?.symbol @@ -592,17 +589,6 @@ export default function transformProps( const forecastValues = extractForecastValuesFromTooltipParams(forecastValue); - const isForecast = Object.values(forecastValues).some( - value => - value.forecastTrend || value.forecastLower || value.forecastUpper, - ); - - const total = Object.values(forecastValues).reduce( - (acc, value) => - value.observation !== undefined ? acc + value.observation : acc, - 0, - ); - const showTotal = richTooltip && !isForecast; const keys = Object.keys(forecastValues); keys.forEach(key => { const value = forecastValues[key]; @@ -637,18 +623,8 @@ export default function transformProps( ? tooltipFormatter : tooltipFormatterSecondary, }); - if (showTotal && value.observation !== undefined) { - row.push(percentFormatter.format(value.observation / (total || 1))); - } rows.push(row); }); - if (showTotal) { - rows.push([ - 'Total', - formatter.format(total), - percentFormatter.format(1), - ]); - } return tooltipHtml( rows, tooltipFormatter(xValue),