• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1298
  • Last Modified:

Specify Gradient Range

Hello,

I am using SQL Server Reporting Services 2008 R2. I use Visual Studio 2008 to develop my reports.

I have a report that contains a Line Chart. The Y-axis of the chart has a range of 0 up to 100. While in design view of the report, if I go to the chart and right-click directly above the X-axis and directly right of the Y-axis, the shortcut menu will allow me to click on Chart Area Properties. After the dialog box appears, I click Fill in the left pane. Now I can set background fill options. I go to Fill Style and choose Gradient, I set the primary color to Automatic, the secondary color to Red, and the Gradient Style to TopBottom (in my case the Automatic [or default] color is white).

When saving my settings and previewing the report, the chart is filled with solid red starting at 0 (on the Y-axis) and as it goes up toward 100, the red begins to fade, until everything is white by the time it reaches 100. All this is expected behavior.

What I would like to be able to do is to limit the gradient range between 0 and 20. I want the solid red, which starts at 0, to begin to fade so that by the time it gets to 20, the red is completely gone, and everything from 20 to 100 is the automatic white color.

I was thinking that if I go back to the Chart Area Properties dialog box, and specifically, the Gradient Style dropdown list, I should be able to enter some kind of expression that would control the range of the gradient. I have tried creating a couple of different expressions, but have had no success. Does anyone know how I can do this?

Thank you
0
brian_appliedcpu
Asked:
brian_appliedcpu
  • 2
1 Solution
 
ValentinoVBI ConsultantCommented:
The functionality you're looking for is called StripLines.  Select your Y-axis by clicking it.  The Properties window now shows Chart Axis.  Locate the StripLines property and click the ellipsis button to get to the ChartStripLine Collection Editor.

Add one StripLine and set the following properties to get your red-white band from 0 to 20:

BackgroundGradientEndColor: Red
BackgroundGradientType: TopBottom
StripWidth: 20

That should do it, just one is needed because the default white background will be used for the remaining chart background area.

Ref. How to: Highlight Chart Data by Adding Strip Lines (Report Builder 3.0 and SSRS)
0
 
brian_appliedcpuAuthor Commented:
Thank you ValentinoV
You nailed it. That is exactly what I needed.
Thank You!
0
 
ValentinoVBI ConsultantCommented:
Glad to hear I could help!  That feature surely is hidden quite well ;)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now