How to Draw line with different colour based on the Y axis range

hello

i would like to know how to draw a line that consist of three or more colours based on the y axis range
like if 0-20 the line should be in one colour and 20 -40 in another and so on

You’ll have to split your data into two traces (unfortunately).