Reputation: 1715
I would like to ensure the labels of my bar chart are above the bars. Can you force a label on top of a bar chart in SQL Server Reporting Services? If so, how?
The issues are the colors are so dark, it's hard to read them if they are not above the bar in the chart. I could just change the colors, but I'd rather learn how to force the label location if possible.
I'd like all numbers to be above the bar, like over the blue bar below. I have over 100 different charts in my report, so the scale will vary greatly depending on the particular report.
Thank you!
Upvotes: 4
Views: 8365
Reputation: 134
I just had this issue, I was able to fix it by making sure the chart series "Smart Labels" - "Disabled" property was set to "True"
This is what my properties pane looks like:
Upvotes: 0
Reputation: 1153
Microsoft do not use the label Position property for some of the chart types.
They tell us what they use by default here - in your case "on bar charts labels are placed outside of the bars that represent data points" (they appear to mean "column charts")...but sometimes with a large value it's placed just inside, sometimes partially in-out (and if you try the "Outside" position it just fails to render!).
As @jayvee has mentioned the trick with Column charts is to select the value and change the SmartLabels AllowOutSidePlotArea to True (from Partial).
However if you have a Stacked Bar chart then labels are always in the centre of the particular value.
The hack to get labels on top is to add an extra Stacked Bar value with the Color set to "No Color" and move it to the top of the values (using the Chart Data designer arrows).
The trick is getting a good expression value to use - a constant ends up too big or too small at some point, so I found a percentage of the stacked values works best (remembering to change Nulls to Zeros)...25% to 30% usually works.
Then set the value Label to the value you want to display in the data label.
Upvotes: 0
Reputation: 41
You have to first make sure the chart type is not stacked.
In my experience the "Position" property doesn't always work. Sometimes you have to go to the properties of the series, then "Custom Attributes", then "Label Style" then select "Top".
What @niktrs said in the comments of the other answer about setting the AllowOutsidePlotArea property is also true.
Upvotes: 2
Reputation: 10875
In Visual Studio, design mode, ensure that the properties window is visible, then click on any of the labels on the chart. At this point, the properties window should show the properties for Chart Series Label. Find the 'Position' property, which probably is showing the value 'Auto', change this value to 'Top' and this should do the trick.
Upvotes: 2