Add the legend title of each line at the right of the last observation on a timeseries. Use clip = false vs. right = of <node> vs. right of = <node.
clip = false
right = of <node>
right of = <node