dosubot[bot] commented on issue #35856: URL: https://github.com/apache/superset/issues/35856#issuecomment-3450604342
<!-- Answer --> Superset doesn't currently support dynamic annotation layers that automatically update with aggregate metrics like the average. The formula annotation for a horizontal line requires a constant value, so it won't update as your data changes. A common workaround is to calculate the average in your SQL query or dataset and add it as a separate metric or series in your chart. This way, the average will update automatically as your data changes. You can then style this series as a line (if the chart type supports it) or use it for reference. If you need the visual effect of a dashed or dotted average line and your chart type doesn't support adding a second series, you'll need to manually update the annotation value whenever your data changes. There isn't a built-in way to link the annotation layer to a dynamic aggregate from the chart data at this time [citation](https://github.com/apache/superset/blob/master/superset-frontend/src/explore/constants.ts). <!-- 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/021f09a6-f708-4bbc-915f-52bcddfd7d00?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/021f09a6-f708-4bbc-915f-52bcddfd7d00?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/021f09a6-f708-4bbc-915f-52bcddfd7d00?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/021f09a6-f708-4bbc-915f-52bcddfd7d00?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/021f09a6-f708-4bbc-915f-52bcddfd7d00?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/021f09a6-f708-4bbc-915f-52bcddfd7d00?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/021f09a6-f708-4bbc-915f-52bcddfd7d00?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu b) [](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/35856) -- 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]
