fix(metric-monitors): Anchor non-percentage chart y-axis at zero#118384
Merged
Conversation
Previously, the detector chart y-axis min value was always calculated with padding from the lowest data point, which could make the axis start far from zero for clustered data. This made small variations appear exaggerated. Now non-percentage metrics anchor the y-axis at 0 for a more accurate visual representation. Percentage metrics still zoom into the data range since pinning to 0 would hide small but meaningful variations (e.g. 90% to 100%).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The detector chart y-axis was previously always zooming into the data range for the min value, which meant that for something like
count()with values clustered around 500, the axis might start at 405 instead of 0.This is due to a previous fix which zoomed in on percentage charts where the data variations would be hard to spot if you are always hovering at 99%: #104035
This doesn't make as much sense for absolute metrics, so I special cased percentages and set the min value to 0 for others (this was the behavior before the above PR).
Before:
After: