Jeff
Jeff

Reputation: 449

Change the line color of a line graph based on a data value in SSRS

I want to change the color of a line in my line graph in SSRS based on a data value. I have the code below. If I leave the false part out, the line I want becomes pink, but the other lines are black. If I put the false part in, then all the lines become invisible. Any thoughts? This code is in the expression box in the line fill color property. Thanks.

=IIf(Fields!Manufacturer.Value = "PRASCO LABS","Hot Pink","#00000000")

Upvotes: 2

Views: 3846

Answers (1)

Ian Preston
Ian Preston

Reputation: 39566

Assuming you just want to overwrite the specified palette colours for that one Manufacturer, you can use:

=IIf(Fields!Manufacturer.Value = "PRASCO LABS", "HotPink", Nothing)

By specifying Nothing, this just tells the chart to use the normal colour from the palette.

I have the following Chart using the normal horrible standard SSRS palette:

enter image description here

Note that PRASCO LABS is Red.

Apply the above expression to the Series Fill property:

enter image description here

PRASCO LABS is now a nice Hot Pink as required.

Upvotes: 1

Related Questions