I have used plotly to create a graph. X axis are timestamps and Y value are “CPU” values. These are actually Erlang reductions so the numbers can be quite large. In my current case, the auto-generated Y axis starts around -2,000,000 and goes up to ~70,000,000.
I wanted to add a representation of an event happening along the range of the graph. I am running tests and what I am working on will impact what happens to Erlang, so that timing is pertinent. I wanted to put a “tick” as a vertical line starting below the 0 x axis and ranging up to 0. This way, these “ticks” won’t overlap any “real” data as it is all positive. If I manually add a trace, or shape, or whatever ranging from -1,000,000 to 0, the size works nicely and it looks like what I want. The user can hover over and see the tooltip which I explain what happened at this time. All works great.
However, then I run a new data set where the Y values range from -10 to 70 and my hard coded value of -1,000,000 skews the graph.
Is there a way of polling the graph for what the max/min Y values are so that I can create this “tick” the appropriate size for any graph?
Is there another feature in plotly that would allow me to accomplish the same thing?