dosubot[bot] commented on issue #33284: URL: https://github.com/apache/superset/issues/33284#issuecomment-2839703828
<!-- Greeting --> Hello @dvsingh-kearney! I'm [Dosu](https://dosu.dev), a bot here to help you solve bugs, answer questions, and assist you in becoming a contributor. I'm ready to help while you wait for a human maintainer. <!-- Answer --> The issue you're experiencing with the stacked bar chart not updating the totals when excluding dimensions from the legend might be related to how the `extractDataTotalValues` function processes the data. This function calculates the total stacked values by summing the values of dimensions that are not excluded based on the `legendState`. If the totals are not updating correctly, it could be due to the function not properly accounting for the legend state when recalculating the totals <sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts)</sup>. To address this, you might want to ensure that the `legendState` is correctly reflecting the dimensions that are currently visible. The function should exclude dimensions that are disabled in the `legendState` from the total calculation. If the logic in the function is not correctly filtering out these dimensions, it could lead to the totals not updating as expected. Additionally, the Y-axis updates correctly because it uses the `computeYDomain` function, which filters out disabled data and calculates the domain based on the visible data <sup>[[2]](https://github.com/apache/superset/blob/master/superset-frontend/plugins/legacy-preset-chart-nvd3/src/utils.js)</sup><sup>[[3]](https://github.com/apache/superset/blob/master/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.js)</sup>. This suggests that the issue is specifically with the total values calculation rather than the Y-axis adjustment. You may need to review the implementation of the `extractDataTotalValues` function to ensure it properly handles the legend state and updates the totals accordingly. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/75e08e62-c7cd-44b8-854a-67a5d7359489?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/75e08e62-c7cd-44b8-854a-67a5d7359489?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/75e08e62-c7cd-44b8-854a-67a5d7359489?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/75e08e62-c7cd-44b8-854a-67a5d7359489?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/75e08e62-c7cd-44b8-854a-67a5d7359489?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/75e08e62-c7cd-44b8-854a-67a5d7359489?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/75e08e62-c7cd-44b8-854a-67a5d7359489?feedback_type=other)</sup> -- 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]
