Unfortunately, it is currently not possible to store a variable or a query as a Y-MAX value in the graph visualization. However, it is possible to achieve the same effect by using an invisible query that has the maximum value. This way the Y-axis is always set to the maximum of the query. The video below shows how this works.