2
votes

I hope this is a simple question, but I have been beating my head against the wall for hours now. I would like to create a column chart in SSRS 2008 with columns that are always the same width and always the same width of space between columns. The catch is that the chart will not always have the same amount of columns.

Here is what I have in scenario 1 with 12 columns:

enter image description here

Here is what I have in scenario 2 with 4 columns:

enter image description here

I would like to see something more like scenario 3 instead:

enter image description here

As of now this is a very simple column chart. The only real modification I have done that I feel will be important to mention is that I have set the PixelPointWidth value to 20 in the Chart Series -> Custom Attributes section. This ensures that the columns all stay the same size. I notice that the PointWidth value in the same section is used to control spacing between columns, but it does so by making the columns larger/smaller to fit. The PointWidth value has no effect when the PixelPointWidth value is greater than zero.

Please help me find the way to keep the columns the same width and also maintain the same width between columns!

1
Perhaps a dynamic width is a suitable workaround? - Jeroen
This is a really good idea that I haven't seen before. I will need to experiment more tomorrow when I have more time. The initial problem I am having is that my chart title is fairly long, and it would be nice not to have to break it up into small chunks for a small chart. In fact, the fewest amount of columns I will have is one, which will be very small width-wise since I need to keep the columns skinny to support 20 columns max. - Joseph
You could either place the chart title in a seperate textbox above the chart, with a fixed width, or create an expression for the dynamic chart width that has a certain minimum. Good luck. - Jeroen
I had a chance to properly test this today and unfortunately it does not seem that it will be a viable solution for me. I can more or less get things to work, but I am still having issues with the labels being cut off or looking funny due to lack of space. Not to mention the dynamic header label for the chart looks out of place as a fixed width textbox that doesn't resize to the width of the chart. It was a great suggestion though, thanks Jeroen! However, I'm still hoping to find a solution that will allow me to keep the chart width intact. - Joseph
Unfortunate. I believe you may come up zero, that there's no real solution. In any case, let us know (even if you find it's not possible) by answering your own question, so others may benefit. Good luck! - Jeroen

1 Answers

3
votes

Manipulate your Dataset so that it always provides rows for Value 01 through to Value 12, with null values for the measure. Then in the Chart's Category Group properties, use an Iif function for the Label property to set it to an empty string "" if the measure is null (or use another column as a flag).