dosubot[bot] commented on issue #37921: URL: https://github.com/apache/superset/issues/37921#issuecomment-3888297917
<!-- Answer --> This duplication is happening in the frontend logic for Mixed Charts. The legend and tooltip labels are built by combining metric and group by names, and the deduplication function (`dedupSeries`) only appends a suffix if it detects duplicate IDs, which doesn't fully resolve cases where the first metric is repeated with group by dimensions. The relevant code is in `transformProps.ts` and `series.ts`—specifically, how display names are constructed and how deduplication is applied. Improving the uniqueness logic for series IDs when multiple metrics and group by fields are present should help fix this edge case. You can review and adjust the display name construction and deduplication logic in these files to ensure each legend/tooltip entry is unique and not duplicated. More details on the implementation can be found [here](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformPro ps.ts) and [here](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts#L261-L687). <!-- 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/efc3e3aa-3e5f-47b9-9955-197a82196d51?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/efc3e3aa-3e5f-47b9-9955-197a82196d51?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/efc3e3aa-3e5f-47b9-9955-197a82196d51?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/efc3e3aa-3e5f-47b9-9955-197a82196d51?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/efc3e3aa-3e5f-47b9-9955-197a82196d51?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/efc3e3aa-3e5f-47b9-9955-197a82196d51?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/efc3e3aa-3e5f-47b9-9955-197a82196d51?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=This%20duplication%20is%20happening%20in%20the%20frontend%20logic%20for%20Mixed%20Charts.%20The%20legend%20and%20tooltip%20labels%20are%20built%20by%20combining%20metric%20and%20group%20by%20names%2C%20and%20the%20deduplication%20function%20%28%60dedupSeries%60%29%20only%20appends%20a%20suffix%20if%20it%20detects%20duplicate%20IDs%2C%20which%20doesn%27t%20fully%20resolve%20cases%20where%20the%20first%20metric%20is%20repeated%20with%20group%20by%20dimensions.%20The%20relevant%20code%20is%20in%20%60transformProps.ts%60%20and%20%60series.ts%60%E2%80%94specifically%2C%20how%20display%20names%20are%20constructed%20and%20how%20deduplication%20is%20applied.%20Improving%20the%20uniqueness%20logic%20for%20series%20IDs%20when%20multiple%20metrics%20and%20gro up%20by%20fields%20are%20present%20should%20help%20fix%20this%20edge%20case.%20You%20can%20review%20and%20adjust%20the%20display%20name%20construction%20and%20deduplication%20logic%20in%20these%20files%20to%20ensure%20each%20legend/tooltip%20entry%20is%20unique%20and%20not%20duplicated.%20More%20details%20on%20the%20implementation%20can%20be%20found%20%5Bhere%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts%29%20and%20%5Bhere%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts%23L261-L687%29.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%2 0this%20issue!&url=https%3A//github.com/apache/superset/issues/37921) -- 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]
