Respondido Data label on bar charts

  • quinta-feira, 21 de outubro de 2010 18:01
     
     

    Hello,

    I have a bar chart where the data labels are centered? Is there a way to make all the data labels aligned at a specific location on all bars regardless of the number?

    I know this contradicts of how statistical data is read, but it is a requirement that I have.

    Thank you


    Abdallah El-Chal, PMP, ITIL, MCTS

Todas as Respostas

  • segunda-feira, 25 de outubro de 2010 06:29
    Moderador
     
     

    Hi,

     

    By generally, Reporting Services allow us to specify the position of the data labels. For the detailed steps about How to Position Labels in a Chart, you can refer to: http://msdn.microsoft.com/en-us/library/ms156263(v=SQL.100).aspx

     

    However, if the built-in feature cannot meet your needs, please post an example to elaborate the requirements and which version of Reporting Services you are using. Then I will provide you further assistance.

     

    Thanks,

    Tony Chain


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
  • quarta-feira, 3 de novembro de 2010 15:24
     
     

    Tony,

    Thank you for responding, and sorry I didn't get back to you earlier. The original requirement was to have the labels set at a specific location regardless of the data. For example, if you have two bars, one with value 90, and one with value 60, they want these values(the bar labels) aligned. So, If we place the values in the center, they don't want the values centerd for each bar. But they want one value to show up at 45(for the 90) for example, and the other value to show up at 45 as well and not at 30. I knew I needed an expression for that, but I wasn't sure how to approach it.

    Anyways, the requirement has changed, but if you can provide some feedback about that expression that would be helpful in case they change their minds.

    Thank you


    Abdallah El-Chal, PMP, ITIL, MCTS
  • quinta-feira, 4 de novembro de 2010 03:34
    Moderador
     
     Respondido

    Hi Abdallah,

     

    Thank you for your further explanation of the requirement. By generally, we can specify the position of data labels of a Bar Chart by the setting the BarLabelStyle property in the CustomAttributes category of a series. However, as you noticed, the position is based on the actual value of each bar. In order to display all data labels aligned the center of the bar with max value like the following picture shows, we need use an additional series.

     

     

    If it is what you need, please refer to the steps below to achieve this:

    1.    Bind the existing data fields to the corresponding chart data. For example, in my report, I add the OrderQuantity field to the Chart data values and add Category field to the category groups of the chart.

    2.    Add a new series to the data value field in the chart with an expression.

    If you are using Reporting Services (SSRS) 2008 R2, you can click the + sign of the ∑Values pane and select Expression.

    In SSRS 2008, please add the data field again, then right click the second one and select Series Properties… In the Series Properties dialog, click the fx button after the Value field dropdown list.

    3.    Specify the expression like:

    =Max(Sum(Fields!OrderQuantity.Value),"Chart1")/2

    This expression will calculate the half of the max bar value. Please be aware to correct the scope name argument in the Max function to the chart name in your report.

    4.    Please right click the new series in the chart and select Show Data Labels.

    5.    Right click the Label and select Series Label Properties… In the Label data dropdown list, correct  the expression to the data field of original series, for example, in my report is

    =Sum(Fields!OrderQuantity.Value)

    6.    In order to hide the addition series, please specify its Color property of the series to No Color.

     

    Thanks,

    Tony Chain

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
  • sexta-feira, 24 de agosto de 2012 08:27
     
     Resposta Proposta

    Hi ,

    These are called Data-points in the graphs.What you need is select the Data-point in the design mode ,Press F4 for properties ,Then you can select the properties "Position" or "Rotation" to show the Data Points in the graphs.There are other common properties as well for Data-points.


    Regards Samay Shrivastava Please mark it as Answered if it answered your question or mark it as Helpful if it helped you solve your problem.

    • Sugerido como Resposta Samay Shrivastava quinta-feira, 20 de setembro de 2012 09:43
    •