How to draw endless line in Graph (old) with X-Axis: Series?

Hi, guys. I have a graph based on Graph (old) in Grafana 8. It shows some info from DB which represents the size of an app in Mbytes grouped by version.
I need to draw a dynamic threshold on this graph. I discovered that a standard threshold can’t use dynamic values from variables, so I should draw it using some pseudo-query.
And I couldn’t find any way to draw it for a long time. The problem is that my X line has a “Series” type. If I change it to “Time,” the line is easy to draw, but I can’t change “Series” because my data on the graph is grouped by the app version, not by the time.
Here’s an example of a pseudo-query I spin around:

select 0 as time,
       $threshold as value1,
       $threshold as value2
from my_table t

With different changes, it draws only a dot or limited line between 2-3 points. Is there any way to draw the endless line?

Result of the query above:


Original graph I operate with: