Creating a Dynamic XY Graph with Multiple Series

Hello everyone!
I would like to create an XY graph with multiple automatic and dynamic series if possible. Here is the SQL query I am using:

SELECT [X_values], [Y_values]
FROM [<My_Table>]
WHERE [CurveID] IN ($My_Var)
ORDER BY [X_values];

In this XY graph, I would like to see each series dynamically generated. The variable $My_Var contains a query that selects all the different IDs of graphs, and I would like to build a graph for each different Graph ID. Since CurveIDs are constantly changing, I would prefer not to add the series as individual queries and manually set them as x and y.
I do not have any timestamp values - only integers in my table. I am using MSSQL as my database.

Could anyone guide me on how to achieve this in Grafana? Any help or tips would be greatly appreciated!

Thank you!