sync legend color with the graph