I am using a pie chart to display the count of a category in a collection.
That category is a count of colors chosen by a user.
So there may be 10 red, 5 green, 3 yellow, etc.
It is working well in terms of getting the correct data!
I would like to fix the colors of the pie chart, though, so the red slice correlates to red, etc.
When I assign specific colors to the slices, though, they do not always correspond with the same category, the color is just assigned to the first data that are retrieved.
For example, if I have defined
Slice 1 - green
Slice 2 - yellow
Slice 3 - orange
Slice 4 - red
But then the user enters a choice of red, then later yellow, the first slice gets assigned to the red choice but its color is green.
Any ideas on a solution to this?