Kristy
Kristy

Reputation: 15

SSRS Expression: Pie chart color based on size of data

I am trying to order the pie chart countries by order count size . The country with the largest order count will be blue, the second largest a dark gray, third largest gray and so on..

This is what my pie chart looks like:

https://i.sstatic.net/dlUKX.png

This is my code:

=SWITCH(Fields!Sales_Territory_Country.Value = "United States","LightSlateGray",
Fields!Sales_Territory_Country.Value = "France","DimGray",
Fields!Sales_Territory_Country.Value = "Canada","LightGrey",
Fields!Sales_Territory_Country.Value = "Germany","Silver",
Fields!Sales_Territory_Country.Value = "United Kingdom","Gray",
Fields!Sales_Territory_Country.Value = "Australia","#3c3a3a",
True, "Plum")

I am simply giving each country a color and this is not what I want to do. I have seen many tutorials basing expressions on size (>100, <2000...) but that isn't what I'm going for either.

Does anyone know how to solve this?

Upvotes: 1

Views: 1769

Answers (1)

Fillet
Fillet

Reputation: 1426

You can define a custom color palette with your colors.

http://technet.microsoft.com/en-us/library/dd239355.aspx

Then order the categories for the pie chart by decreasing order count size.

That should be it: no need to explicitly set the color using a switch statement.

Upvotes: 2

Related Questions