Dynamically change legend names in xy chart

Hi, I have variables named “modelname”, “minthreashold”, “maxthreshold” and etc.
i have an xy-chart plotted with precision on x-axis and recall on y-axis. I want the legend of this xy-chart to show the modelnames which ever i have selected. Number of modelname will very when we deploy more data from our application, so if modelname changes it should also reflect in legend of graph. currently legend is showing as recall, i don’t want that but the modelnames i have selected in above variables.

i don’t want to use override as i have more than 100 models, and i cannot keep doing for so many models. can anyone please help.

eg: modelnames:
221345_extended_bike
231567_bike

if i select both modelnames then both should come in my legend.
if we cannot achieve this in xy-chart, can you suggest which other i can consider also how to do it in that graph.

Thanks in advance.