How to plot overlapping non-timeseries graphs

Hello! I wish to plot multiple overlapping non-timeseries graphs that can be differentiated by color. I have tried Plotly and Scatter plugins but no luck. The data I have in InfluxDB is structured as such:

time | y1 | y2 | x | index | mac | timestamp
111 33 35 0 0 AABBCC001122 111
111 40 30 1 99 AABBCC001122 111
111 65 20 2 98 AABBCC001122 111
111 93 19 3 97 AABBCC001122 111

y1, y2 and x are the fields while index, mac and timestamp as the tag values. The timestamp values are the same as the time values and are used to group the data when querying. There are many such sets of data inserted into the database at different times and with different mac addresses. The 4 points above are from one set of data.

I am able to query successfully. For example, if my query returns 2 sets of data with different timestamps, I get the following plot using Scatter when plotting x vs y1.

It seems like a line connects the last point of the first dataset to the first point of second dataset. On Plotly, even with the same query, I am only able to use a trace for one dataset by selecting the x and y values from a specific time. Is there any way this can be done in Grafana?