Hi, you could add each line segment as a single trace and change the line color of the corresponding segment.
Pretty much like this (unfortunately Python):
Hi, you could add each line segment as a single trace and change the line color of the corresponding segment.
Pretty much like this (unfortunately Python):