user1982427
user1982427

Reputation: 41

Can I colour my Chart Area background in Mutiple Colours bands - SSRS 2008 R2

Can I colour my Chart Area background in Mutiple Colours bands

That is based on Y - vertical Axis Is it possible to have mutiple bands Ex:In scale of 1 to 100 on Y Axis , Is it possible to have - 0 -30 Green, 30-70 Blue and 70 -100 Red bands of three different colours

Two colours is possible as background by Alternating Colours, Like this is it possible with 3 or more colours.

Please help

Upvotes: 1

Views: 2926

Answers (2)

Valentino Vranken
Valentino Vranken

Reputation: 5815

Different background color bands on SSRS charts are achieved through the StripLines functionality.

Have a look at the great answer in following related question: Conditional background color in line charts

Upvotes: 0

djangojazz
djangojazz

Reputation: 13242

You can alternate colors using the rownumber expression for rows.

=iif(columnnumber(nothing) mod 2, "Green", "blue")

For columns it is a little more tricky. It would be far easier to bind the colors explicitly using a column value you KNOW will be a certain value.

IIF( (ColumnName) = (predicate), "Red", 
  IIF( (ColumnName) = (predicate2), "Green", "Blue"))

To do either of these just go to the property of a row, column or cell and go to background. Hit drop down, select 'Expression' and put in the code.

EDIT: Working example below will work for TABLE object only NOT a matrix. Matrix can have dynamically changing values so you need a bit more code to account for that.

Alternates three colors on a table:

=iif(rownumber(nothing) mod 3=1, "Green", 
    iif(rownumber(nothing) mod 3=0, "Blue", "Gray"))

Upvotes: 1

Related Questions