Fix issue where colors in the legend are not aligned with colors in the graph