Monday, July 3, 2023

SSRS - How to change the color of the legends in the chart.

The objective of this article is to provide a solution to change the color of legends in the charts according to your choice or based on business requirement. By default, SSRS shows coloring of legends automatically. Based on our requirement, we can change it. 

Below  SSRS Report showing 2 similar Pie chart showing Region wise Sales information. We will change the coloring in one of the chart to see difference. 

Based on my requirement, I need to show this information with Red,Orange & Green color. 

Following are the steps to change the coloring of legends in the chart.

1) Right Click over the Pie Chart, go to Series Property then Fill. Here you can see the coloring is set to automatic.


2) Click on the expression button and write the conditional expression for your coloring requirement. E.g.

=IIF(Sum(CINT(Fields!SalesAmount.Value)) < 500,"Red",IIF(Sum(CINT(Fields!SalesAmount.Value)) <1000,"Orange","Green"))


If Sales Amount is less than 500 then Red Color

If Sales Amount is greate than 500 but less than 1000  then Orange Color

If Sales Amount is greater than 1000 then Green Color

Now run the report. you can see the difference in coloring in charts.



No comments:

Post a Comment