dosubot[bot] commented on issue #37882: URL: https://github.com/apache/superset/issues/37882#issuecomment-3882941225
<!-- Greeting --> Hi @pankaj45! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. <!-- Answer --> This is a known limitation in Superset's cross-filtering for eCharts-based stacked bar charts with multiple metrics. When you use more than one metric, Superset builds legend and cross-filter labels by combining the metric label (or SQL expression) with the groupby dimension value. As a result, the emitted filter uses the metric label instead of just the dimension value, which causes downstream charts to receive invalid filters and return no rows. There is currently no built-in workaround to force Superset to filter only by dimension values in this scenario—the recommended approach is to use only one metric per chart when cross-filtering is needed, or avoid cross-filtering in multi-metric charts. This limitation is still present as of v6.0.0 and the latest mainline; recent PRs have improved cross-filtering for bar charts without dimensions, but not for stacked/multi-metric bar charts. You can track this limitation and related discussions [here](https://github.com/apache/superset /discussions/34689#discussioncomment-14101769). If you want to contribute a fix, the relevant code paths are the construction and mapping of `seriesName` and `labelMap` in the ECharts plugin code, especially how `getCrossFilterDataMask` and the event handler extract values for cross-filter emission. A robust fix would require changes to reliably extract only the groupby dimension value for cross-filter emission when multiple metrics are present. <!-- 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/7ce81fac-d1ad-49ff-963c-bc3aa3574263?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/7ce81fac-d1ad-49ff-963c-bc3aa3574263?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/7ce81fac-d1ad-49ff-963c-bc3aa3574263?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/7ce81fac-d1ad-49ff-963c-bc3aa3574263?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7ce81fac-d1ad-49ff-963c-bc3aa3574263?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/7ce81fac-d1ad-49ff-963c-bc3aa3574263?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7ce81fac-d1ad-49ff-963c-bc3aa3574263?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=This%20is%20a%20known%20limitation%20in%20Superset%27s%20cross-filtering%20for%20eCharts-based%20stacked%20bar%20charts%20with%20multiple%20metrics.%20When%20you%20use%20more%20than%20one%20metric%2C%20Superset%20builds%20legend%20and%20cross-filter%20labels%20by%20combining%20the%20metric%20label%20%28or%20SQL%20expression%29%20with%20the%20groupby%20dimension%20value.%20As%20a%20result%2C%20the%20emitted%20filter%20uses%20the%20metric%20label%20instead%20of%20just%20the%20dimension%20value%2C%20which%20causes%20downstream%20charts%20to%20receive%20invalid%20filters%20and%20return%20no%20rows.%20There%20is%20currently%20no%20built-in%20workaround%20to%20force%20Superset%20to%20filter%20only%20by%20dimension%20values%20in%20this%20scenario%E2%80%94 the%20recommended%20approach%20is%20to%20use%20only%20one%20metric%20per%20chart%20when%20cross-filtering%20is%20needed%2C%20or%20avoid%20cross-filtering%20in%20multi-metric%20charts.%20This%20limitation%20is%20still%20present%20as%20of%20v6.0.0%20and%20the%20latest%20mainline%3B%20recent%20PRs%20have%20improved%20cross-filtering%20for%20bar%20charts%20without%20dimensions%2C%20but%20not%20for%20stacked/multi-metric%20bar%20charts.%20You%20can%20track%20this%20limitation%20and%20related%20discussions%20%5Bhere%5D%28https%3A//github.com/apache/superset/discussions/34689%23discussioncomment-14101769%29.%0A%0AIf%20you%20want%20to%20contribute%20a%20fix%2C%20the%20relevant%20code%20paths%20are%20the%20construction%20and%20mapping%20of%20%60seriesName%60%20and%20%60labelMap%60%20in%20the%20ECharts%20plugin%20code%2C%20especially%20how%20%60getCrossFilterDataMask%60%20and%20the%20event%20handler%20extract%20values%20for%20cross-filter%20emission.%20A%20robust%20fix%20would%20require%20cha nges%20to%20reliably%20extract%20only%20the%20groupby%20dimension%20value%20for%20cross-filter%20emission%20when%20multiple%20metrics%20are%20present.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/37882) -- 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]
