How do I keep the legends/colours of SSRS charts consistent?

醉酒当歌 提交于 2019-12-24 04:03:26

问题


I have been having a couple of issues with my charts in SSRS. Basically, the graphs display the results of a sharepoint survey by counting up the totals of question responses. (For example, the speed rating graph below uses =Count(Fields!Speed_Rating.Value) to get its data. )

The responses to these questions can range from Very Poor to Very good as shown below in the Speed rating graph.

The problem I am having is that because there has not yet been a Very Poor response to the Professionalism question yet, Very Poor does not appear in the legend/chart. This stops it being consistent with the other charts even though they should be displaying similar data.

Is there a way to ensure that either the colours stay the same for each field across all charts or that all the fields show up in the legend even when there isn't data present for it?


回答1:


This is a duplicate as noted above.

You can set the series color property using a switch statement eg

=Switch(Fields!Speed_Rating.Value="Very Poor","DarkRed", Fields!Speed_Rating.Value="Poor","Orange",Fields!Speed_Rating.Value="Good", "Green", Fields!Speed_Rating.Value="Very Good","Blue")


来源:https://stackoverflow.com/questions/29769512/how-do-i-keep-the-legends-colours-of-ssrs-charts-consistent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!