Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS pie chart color coding

I have an ssrs report where I have many pie charts with the fields pass and fail as well as up to 3 other miscellaneous fields and I wish to be able to color the pass always green and the fail always red but the other fields could be a default value. Is this even possible to do? I have seen code examples with code for custom color in pie charts but I have no clue how to do this and have not found where I would put my custom code. What im trying to do is slightly different from what all those other examples do whith only defining a few fields.

like image 885
FLG Avatar asked Jan 17 '23 00:01

FLG


1 Answers

=Switch
(
Fields!ResultTypeDescription.Value = "Pass", "Green",
Fields!ResultTypeDescription.Value = "Fail", "Red",
Fields!ResultTypeDescription.Value = "Assigned To Machine", "Blue",
Fields!ResultTypeDescription.Value = "Not Yet Assigned", "Orange",
True , "Gray"

)

In order to get our dynamic coloring working,i overrode the colors from the palette. This is how it’s done. Right-click on the pie and select Series Properties. Select the Fill page and click the Expression (fx) button to define the color.

like image 86
FLG Avatar answered Jan 31 '23 10:01

FLG