Graph line colors legend

Graphs not only have customized line colors, but those colors are used as part the generated legend!
That's *two* merge requests for the price of *one*! :+1:

Also did some minor formatting and code cleanup.
[#74535922]
[#74536668]