Skip to content

feat(dashboards): Allow constraining the Y axis range to data min and max in TimeSeriesWidgetVisualization #90247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

gggritso
Copy link
Member

@gggritso gggritso commented Apr 23, 2025

Closes DAIN-377: Allow setting automatic Y axis min except for a huge caveat with release bubbles.

Adds a new prop to TimeSeriesWidgetVisualization. If axisRange is set to "axisRange", the Y axis doesn't start at 0, it starts at the data min. The story has an explanation of when this is useful and how to use it.

e.g.,
These two charts plot the same data series!
Screenshot 2025-05-23 at 2 43 39 PM

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 23, 2025
@gggritso
Copy link
Member Author

gggritso commented Apr 23, 2025

@billyvg this PR has a story with a simple repro case for the bubbles limitation. In the third chart in the section, you can click the "Releases" legend item to hide the bubbles and the Y axis will be constrained correctly.

billyvg added a commit that referenced this pull request May 20, 2025
By default, release bubbles will use the default y-axis. This generally
works except when the chart does not start at "y=0" as the bubbles are
hard-coded to show below "y=0". With this change, the
`useReleaseBubbles` hook returns a yaxis object that the hook consumer
can use to pass to echarts -- you will also need to configure
`yaxisIndex` to tell the release bubbles series which yaxis to use. This
works by adding a new yaxis to decouple release bubbles series from the
default yaxis. This new yaxis is configured to be hidden.

This also works if you ignore the returned y-axis object and don't
specify a `yaxisIndex` since it will use the default yaxis (assuming it
starts at 0).

Unblocks #90247
andrewshie-sentry pushed a commit that referenced this pull request May 20, 2025
By default, release bubbles will use the default y-axis. This generally
works except when the chart does not start at "y=0" as the bubbles are
hard-coded to show below "y=0". With this change, the
`useReleaseBubbles` hook returns a yaxis object that the hook consumer
can use to pass to echarts -- you will also need to configure
`yaxisIndex` to tell the release bubbles series which yaxis to use. This
works by adding a new yaxis to decouple release bubbles series from the
default yaxis. This new yaxis is configured to be hidden.

This also works if you ignore the returned y-axis object and don't
specify a `yaxisIndex` since it will use the default yaxis (assuming it
starts at 0).

Unblocks #90247
Copy link

codecov bot commented May 23, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...timeSeriesWidget/timeSeriesWidgetVisualization.tsx 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #90247      +/-   ##
==========================================
+ Coverage   85.66%   87.71%   +2.05%     
==========================================
  Files       10174    10247      +73     
  Lines      583386   577620    -5766     
  Branches    22594    22696     +102     
==========================================
+ Hits       499733   506676    +6943     
+ Misses      83201    70501   -12700     
+ Partials      452      443       -9     

@gggritso gggritso marked this pull request as ready for review May 23, 2025 18:58
@gggritso gggritso requested a review from a team as a code owner May 23, 2025 18:58
@gggritso gggritso merged commit 6bda3fc into master May 23, 2025
43 checks passed
@gggritso gggritso deleted the georgegritsouk/dain-377-allow-setting-automatic-y-axis-min branch May 23, 2025 19:24
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.

3 participants