Skip to content
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

Feature Request: Y axis auto min/max that aligns min/max across many graphs #4156

Open
sslupsky opened this issue Feb 26, 2016 · 24 comments
Open

Comments

@sslupsky
Copy link

Hi, I am wondering if others would find it helpful to be able to configure the "Y-Span" in the Axes & Grid settings of the Graph panel? That is, in addition to specifying the Y-Max or Y-Min, there is a third box for selecting the "Y-Span". By specifying a span here, the panel is rendered using the span specified.

This would help alleviate the situation where two graphs are rendered with vastly different spans because one graph has a large gradual change in magnitude (graph A) and the other graph has a small change on a basically flat line (graph B). Generally, the eye would be drawn to the small change in graph B because the auto scale would make this look like a large change but when you look at the Y axis it becomes apparent the span is much smaller than graph A. If the "average" value of these two graphs is the same, then setting the Y-Max and the Y-Min would suffice. But if one graph is offset compared to the other, and that offset changes over time, then using Y-Max and Y-Min is not practical because you have to set the span so large as to make it difficult to see any changes. So, it would be preferable to view the two graphs with the same span.

@torkelo
Copy link
Member

torkelo commented Feb 29, 2016

can you describe more how the span would work ? How would it be implemented?

@torkelo torkelo added the needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc label Feb 29, 2016
@CamJN
Copy link

CamJN commented Mar 3, 2016

There are a few options that might work, one limit could be left as auto (max or min) and the other could be a fixed offset from it (say y-max:auto y-min: max - 10) another option would be setting the max and min as relative to the average value (say y-max:avg + 10 y-min: avg - 10).

@torkelo torkelo changed the title Feature Request: Y axis span setting Feature Request: Y axis auto min/max that aligns min/max across many graphs May 29, 2016
@thoj
Copy link

thoj commented Jul 20, 2016

I understand that this function is probably only useful for very few people. But I've been hacking on this a bit. And I've come up with something that works for me. The commit in my fork adds a Y-Span box to the Axes tab.

Where X is a integer or float:

~X Span X around average
=X Span X around current value
>X Span is atleast X
<X Span is clamped to X

thoj@7dcdccb

Example of why i need it:
y-span

Any interest in a PR?

@tomnewport
Copy link

👍 This would make me happy

@hahnjo
Copy link
Contributor

hahnjo commented Apr 30, 2018

As my issue #11783 has been closed as a duplicate of this I wanted to see if somebody is working on this? The currently referenced PR's (#5720 and the (merged) refactor in #6051) only seem to deal with extending functionality of Y-Min and Y-Max, but not with aligning the axes across different graphs.

@jhavens12
Copy link

I'd also like to see this implemented

@games130
Copy link

+1

@games130
Copy link

Implementation idea:

  1. an additional parameter to select an existing graph and follow that graph's span
  2. additional parameter where you input an index. graphs with similiar index will use span based on the graph with the largest span

@KorkyPlunger
Copy link

KorkyPlunger commented Mar 19, 2019

I would also like to see this feature, as I have the same problem as @thoj.

We have multiple panels representing different statistical views (e.g. max vs 95th percentile), each panel containing the same metrics. We'd like to be able to visually discern the difference between these two statistics for any given metric, but that is not currently possible without hard-coding the Y axis on each panel to be the same. Since the range of values in these panels changes wildly based on the metrics involved (which are chosen using templates), hard-coding is not an option.

I think @thoj's solution would be reasonable, as would @games130's first suggestion.

@shevyf
Copy link

shevyf commented Mar 21, 2019

Hello, another vote in favour of thisplease! Even if the y-axis box could accept a template variable that would be something, and using a custom templating variable to adjust the y-axis across multiple panels as needed. Perhaps even a type of variable that accepts a metric name, and uses it to obtain a max value, like in a singlestatpanel or legend?

@RollingFred
Copy link

RollingFred commented May 1, 2019

+1 on @games130 second suggestion. "Linking" multiple graphs so all these graphs end up with the same Min/Max.
For example, you graph Avg CPU Utilization (%) on different clusters, one varies between 1 and 2%, another varies between 20 and 70%, I'd like to have these two graphs linked so the Y-axis becomes 1%-70%. My eyes will be drawn to the 20%-70% graph while the other will be very low and flat, i.e. doesn't need to be looked at.
@games130 first suggestion would force me to know upfront which one has the biggest span.

@cagnulein
Copy link

+1!

@Atalonica
Copy link

+1

@m2jean
Copy link

m2jean commented Sep 24, 2019

This will be so useful for us to highlight the differences across multiple charts!

@czert
Copy link

czert commented Oct 18, 2019

How about adding a simple "Share YAxis" setting to the "Repeating" section of general settings? That would solve my use case completely.

(Separate checkbox for each Y axis might be handy.)

@MarcoMartines
Copy link

+1
It would be really helpful for me.
I trying to use Grafana to compare the data of two machines that are supposed to work in the same way and with autorange i cannot spot some differences.

@dephcon
Copy link

dephcon commented Jul 20, 2020

+1

@dihamilton
Copy link

dihamilton commented Aug 4, 2020

+1
I have a situation where I want to display a graph of orders over time plus another one showing the same results from a year ago. This works fine with time shifting, but the Y axes are independent. If they are auto it's unclear whether there has been any change year on year. If I set them to a fixed min and max then changing to a large time period can cause the numbers to blow past the max. I would love the option to set the primary graph Y axis to auto and then set the other one to follow it. That way the dynamic time periods would work and the relative scale would be preserved.

@kdorsel
Copy link

kdorsel commented Oct 23, 2020

My current workaround for this is to create a second query with the hardcoded min/max values. In series override I then hide it in tooltip, series, and point. (I only display points on the graph).

The second query would look like this :

select now() as "time", 13.3
union
select now(), 13.5

image

@adamkdean
Copy link

This would be very useful, as you could then visually appraise a set of data from their magnitude across a number of different charts, rather than being forced to either set fixed limits or combine into a single chart.

This could work by inheriting a y-max/y-min from another panel.

@dhawal1248
Copy link

+1

@torkelo
Copy link
Member

torkelo commented Jan 16, 2021

Yes!

@torkelo torkelo reopened this Jan 16, 2021
Copy link
Contributor

This issue has been automatically marked as stale because it has not had activity in the last year. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!

@github-actions github-actions bot added the stale Issue with no recent activity label Jan 19, 2024
@sylr
Copy link

sylr commented Jan 19, 2024

Still relevant.

@github-actions github-actions bot removed the stale Issue with no recent activity label Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests