SSRS stacked bar chart label position

ε祈祈猫儿з 提交于 2020-01-14 13:35:08

问题


I am using SQL Server 2012. SSRS

I have a stacked bar charts that includes interest and dividends. I would like to add the sum of these values to the area just above the stacked bar chart. I have tried adjusting various properties for the labels but I can't get the label position to be anywhere but the middle of the stacked bar chart. Any ideas how to get these labels to be just above the stacked bar charts?


回答1:


There is not a way to do this with settings.

Here are a couple of links that give you step by step instructions:

  • http://beyondrelational.com/modules/2/blogs/65/posts/11575/display-total-on-top-of-stacked-chart.aspx
  • http://social.msdn.microsoft.com/Forums/sqlserver/en-US/654f30c2-ad3a-4b4e-a34f-adf4db6b78d2/stacked-column-chart-total?forum=sqlreportingservices

Basically, the workaround is to create another series or category in your chart that is the totals (which requires updating your dataset to include the totals), make it transparent, and turn data labels on. The MSDN answer says to make it a line chart while the Beyond Relational article leaves it as part of the stacked bar. Either way will work.




回答2:


I tried the solutions mentioned here and found them cumbersome compared to this gem: http://peltiertech.com/label-totals-on-stacked-charts/

  1. Add a "total" to your dataset (in my case, a percentage)
  2. Add the total series to your stacked bar chart
  3. Change the total series chart type to a line
  4. Hide the line and line markers by setting their fill color to none
  5. Set the Total series to not show in the legend
  6. Set the data point position for your total series to "Top"

Here is my result:



来源:https://stackoverflow.com/questions/19819790/ssrs-stacked-bar-chart-label-position

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!