Bug description
- Create a bar chart
- Add a Annotation Layer using Formula
- Ensure that rich tool tip is enabled
- When hovering over the bar chart the value from the annotation layer is included in the rich tooltip and is included in the total value.
Screenshots/recordings
Superset version
4.1.1
Python version
3.9
Node version
16
Browser
Chrome
Additional context
Assuming that some users are using the annotation layers to create baselines and/or goals it would be great if either: 1) The annotation layer value was not included in the tooltip, or; 2) Annotation layers has an option to not include the values in the rich tooltip.
Checklist
- [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
Hey @MarkAajuLarsen! 👋 I'm here to help you with any bugs, questions, or contributions you have for the project. Let's squash those bugs together!
The issue you're experiencing is related to the inclusion of formula-based annotation layers in the total value displayed in the rich tooltip for bar charts. Currently, there isn't a specific configuration or property in the Superset codebase that controls the exclusion of annotation layers from tooltips [1].
To address this, you might consider implementing a feature that allows users to toggle the inclusion of annotation layer values in tooltips. This could involve adding a configuration option to the annotation layer settings, enabling users to specify whether the values should be included in the tooltip calculations.
If you're looking to modify the behavior, you would need to explore the tooltip generation logic and annotation layer processing in the Superset codebase, particularly in files related to chart rendering and tooltip configuration.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other
Comment From: rusackas
Interesting find! While @michael-s-molina worked on these tooltips not so long ago and might have some insight, I don't think Annotaion Layers have an active/engaged "owner" at the moment, so I'd encourage you to investigate and open a fix PR if you're feeling adventurous! :)
Comment From: sfirke
I can corroborate this bug in 4.1.2. The rich tooltips on my charts with annotations are not good:
Comment From: sfirke
Good news: in 5.0.0rc3 you can control whether percentages are displayed in the rich tooltip. That means for charts with annotation lines, you can turn off the problematic percentages that include annotations. Like this:
Now, with the percentages on, annotation layer is still included which is a bug and this should be kept open:
But it's now a much lower-importance bug since it's not in your face.