Y axis: define max value but adjust if all points are lower

  • What Grafana version and what operating system are you using?
    v8.3.1 (8d38082755) Windows 10

  • What are you trying to achieve?
    I’d like to set the max value of the y axis but let it adjust if all points are lower.
    Suppose I set the y max to 10, and the data points are [4,5,2].
    At present, the panel scales to 10, regardless of the data.
    I would like the axis to, in this situation, adjust to something close to 5. If there was a data point above 10, then it would remain at 10.
    In a sense this is the inverse of the current soft max, which adjusts only if the values are higher than the defined max value.

  • How are you trying to achieve it?
    I’m not sure this is possible.

  • What happened?
    N/A

  • What did you expect to happen?
    As explained above.

  • Can you copy/paste the configuration(s) that you are having problems with?
    N/A

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No

  • Did you follow any online instructions? If so, what is the URL?
    No

I think you might want to experiment with the config from query results transformation:

Thank you for your reply, Matt.

I had already looked into this option (should have mentioned in the initial post), but my query uses regex to find any matching (InfluxDB) measurements, and within that regex is a variable that’s used for repeating panels. This essentially:
image
where panels repeat according to EfflParamGrabComp.
This means that in practice, each repeating panel will have a varying number of series, and they will have different names. What I see from Config from query results is that it requires that I specify in advance exactly how which field will be used, which is not possible for repeating panels.

Another point is that, even if the above was possible, I couldn’t find a way of implementing the condition of having the max value of given query be used as the y-max only if this value is below a threshold.

Perhaps I am missing something?