das ist Michael Könings Blog, später mehr...
I had to create charts for a HR department that show the distribution of age (or years of service) and gender in organization units. The customer wanted that typical Christmas tree look, which shows a symmetric bar chart in two directions, like shown in the example below.
There are two challenges here:
How can you achieve that in Reporting Services ?
We use the Dundas chart control with the Bar Chart layout. A stacked bar chart did not work too well for me, it did not put the labels on the tip of the bars.
To have the values point in to directions multiply one set of data with -1. you can do that in your query or by editing the value expression.
The value expression for the data column might look like this:
=IIF(Fields!Gender.Value = "Male" , Sum(Fields!Head_Count.Value),Sum(Fields!Head_Count.Value)*-1)
Since we have gender on one axis, it will show the values in two different colours.
The default settings of the bar chart will draw the different bars with a little offset (side by side), so it would not look symmetrically. I found this parameter that sorts this one out:
the Custom Attribute DrawSidebySide of the Chart Series should be set to False. Now the two bars for each gender in one time period are in line nicely.
What's left to do?
We need to take care of the negative label values for the gender pointing to the left. You guessed how I did it:
change the series label Format property and the Axis LabelsFormat to your wish:
0;0 did the job for me.
That's it! Maybe you have a better way to do it ? Let us know! Put a comment!
Too brief ? ask questions!
Thanks! it works brilliantly