Skip to content

fix(metric-monitors): Anchor non-percentage chart y-axis at zero#118384

Merged
malwilley merged 1 commit into
masterfrom
malwilley/chart-axis-start-from-zero
Jun 24, 2026
Merged

fix(metric-monitors): Anchor non-percentage chart y-axis at zero#118384
malwilley merged 1 commit into
masterfrom
malwilley/chart-axis-start-from-zero

Conversation

@malwilley

Copy link
Copy Markdown
Member

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:

CleanShot 2026-06-24 at 12 14 33@2x

After:

CleanShot 2026-06-24 at 12 14 44@2x

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%).
@malwilley malwilley requested a review from scttcper June 24, 2026 19:18
@malwilley malwilley requested a review from a team as a code owner June 24, 2026 19:18
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 24, 2026
@malwilley malwilley changed the title fix(detectors): Anchor non-percentage chart y-axis at zero fix(metric-monitors): Anchor non-percentage chart y-axis at zero Jun 24, 2026

@scttcper scttcper left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@malwilley malwilley merged commit f04adfb into master Jun 24, 2026
72 checks passed
@malwilley malwilley deleted the malwilley/chart-axis-start-from-zero branch June 24, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants