dosubot[bot] commented on issue #40419: URL: https://github.com/apache/superset/issues/40419#issuecomment-4534240783
<!-- Answer --> This is a confirmed bug that has been partially addressed before. Issues #34030 and #35909 describe the same formatter swapping problem [[1]](https://github.com/apache/superset/issues/34030#issuecomment-3029899464) [[2]](https://github.com/apache/superset/issues/35909). PR #35224 (merged Sept 2025) fixed the **tooltip** formatting but did **not** fix the value labels rendered directly on the chart [[3]](https://github.com/apache/superset/pull/35224). **Root cause**: In [`transformProps.ts`](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts#L404-L468), the formatter assignment is hardcoded by query rather than by axis: - Query A series always use `customFormatters` (built with `yAxisFormat` — the primary axis format) - Query B series always use `customFormattersSecondary` (built with `yAxisFormatSecondary` — the secondary axis format) This means the formatters are tied to Query A/B identity, not to the actual Y-axis each query is assigned to. When a user assigns Query A to the secondary axis and Query B to the primary axis, the value labels get the wrong formatter — even though the tooltip logic (lines 654–680) correctly resolves this by checking `primarySeries.has(key)` dynamically [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts#L654-L680). **Suggested fix direction**: The formatter selection for value labels (lines 404–410 and 462–468) should check `yAxisIndex` / `yAxisIndexB` to determine whether to use `customFormatters` or `customFormattersSecondary`, similar to how the tooltip formatter already handles this. For example: ```typescript // For Query A series: const seriesFormatter = getFormatter( yAxisIndex === 1 ? customFormattersSecondary : customFormatters, yAxisIndex === 1 ? formatterSecondary : formatter, metrics, labelMap?.[seriesName]?.[0], !!contributionMode, ); // For Query B series: const seriesFormatter = getFormatter( yAxisIndexB === 1 ? customFormattersSecondary : customFormatters, yAxisIndexB === 1 ? formatterSecondary : formatter, metricsB, labelMapB?.[seriesName]?.[0], !!contributionMode, ); ``` The relevant file is `superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts`. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=08e4ae4e-b0fb-412e-89df-0fc42cd0ece4) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset) -- 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]
