How to change the color in XY Chart just for only one plot based on the tag value of the other plot

I am working on the XY charts , where I would like to change the one of the plot’s color based on the the tag value of the other plot. Both there plots has the the historian tags. Could you guys help me out? The second image is something I am planning to do :