简体   繁体   English

SSRS饼图颜色编码

[英]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. 我有一个ssrs报告,我有很多饼图,字段通过和失败以及最多3个其他杂项字段,我希望能够为通道着色始终为绿色,失败总是红色,但其他字段可能是默认值。 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. 我试图做的与所有其他例子略有不同,仅仅定义了几个字段。

=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. 选择“填充”页面,然后单击“表达式”(fx)按钮以定义颜色。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM