BLOGS BY TOPIC▼
BLOGS BY AUTHOR▼
BLOGS BY YEAR▼
Posted by Andy Brown on 08 August 2011
You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
Gradient Fill Colours for SSRS 2008 Chart Data Series
Following a question from a recent Reporting Services training course (thanks David N.!) ...
It's not often that I blog with a question rather than an answer, but I was wondering if anyone out there knows the answer to the following question?
Given a chart with more than one data series, as below, how can you apply fill patterns to each series in SQL Server Reporting Services 2008 R2?
Before considering the answer, here are some ideas which don't work.
Assigning a Custom Palette
I'm aware that you can assign a custom colour palette to a chart by changing the chart's properties, as shown below:
The chart properties dialog box
You can then create a set of colours for the custom palette for this chart using the CustomPaletteColors collection:
Click on the build button shown to choose a set of colours.
You can then build up a set of colours - here we need at least 2, because the chart has two data series:
You can add colours one by one
All of this gives you control over the colours of your chart's data series:
Assigning a custom palette has allowed us to choose the colours for each data series.
All very nice - but how can you set fill effects like gradient patterns for the chart data series?
Changing the Properties of a Data Series
I'm also aware that you can change the properties of chart data series:
Right-click on any data series and choose the menu option shown.
I can now set any fill pattern I like:
Here I've gone for a purplish gradient effect.
The problem is that the effect I choose will be applied to all of the data series:
I've successfully changed the fill effect of every data series, but I only wanted to change the effect for one of them.
Using Expressions to Colour Data Points
I'm aware that you can use expressions to set the colour of individual data points, as per this Microsoft article, but I want some simple approach. There must be one!
People with Close Answers
Unusually, intensive googling hasn't yielded an answer. Here are some helpful links:
- ChinChin may have answered the question in this blog - but I don't understand it!
- Microsoft seem to answer the question with a throwaway line in this MSDN article - but again, I can't make sense of it.
So - what am I missing? If you can add the right answer below, the SSRS world will be grateful (or at least, this member of it will be).