none
sum of Legend Values in Pie Chart RRS feed

  • Question

  • I want to the sum of Legend vales at the down line of Legend shown in pie chart.

    For Ex: 

    Blue- 10

    Red- 20

    Green- 30

    ---------------

    Total-60

    • Edited by Pritam Das Wednesday, November 19, 2014 12:54 PM
    Wednesday, November 19, 2014 9:51 AM

Answers

  • Hi Pritam Das,

    Per my understanding that you want to splice the amount value to the existing Legend value in the pie chart like this “ Legend Value – Amount Value” and finally get the total amount under the Legend value  like this “Total – Total Amount”, right?

    Generally, when a field is placed in the Values area of the chart, a legend item is automatically generated that contains the name of this field. Every legend item is connected to an individual series on the chart, so if you add an Total as one of the legend value, it will also added as one part of the pie chart.

    I have tested on my local environment and I recommend you to display the total at the right of every legend value, we can do this by using the expression in the Custom legend text box to splice the amount value and the Total Amount together.

    Details steps below for your reference:

    1. Right click the Values Area to select the “Series Properties”
    2. Click Legend on the left pane in  the Series Properties window  and put this expression in the Custom legend text:
      =Fields!Legendfields.Value &  "-"  & Sum(Fields!AmountFields.Value) & "     Total -  "  &Sum(Fields!SalesAmount.Value,"DataSet1")
    3. Preview and it will display like this:

    Article about the Change the Text of a Legend Item for your reference:
    http://msdn.microsoft.com/en-us/library/dd220595.aspx

    If your problem still exists, please feel free to ask.

    Regards
    Vicky Liu

    Thursday, November 20, 2014 5:33 AM
    Moderator

All replies

  • isnt it same as summing the full values from dataset used?

    In that case you can simply use

    =SUM(Fields!DatasetField.Value,"DatasetName")


    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Wednesday, November 19, 2014 10:54 AM
  • Mr. Visakh,

    I want the sum of Display Legend vales under the Legend List(Index) in Pie chart. Because SSRS not allow me to add new control with Expression(

    =SUM(Fields!DatasetField.Value,"DatasetName")

    ) inside chart control.

    Wednesday, November 19, 2014 12:58 PM
  • Hi Pritam Das,

    Per my understanding that you want to splice the amount value to the existing Legend value in the pie chart like this “ Legend Value – Amount Value” and finally get the total amount under the Legend value  like this “Total – Total Amount”, right?

    Generally, when a field is placed in the Values area of the chart, a legend item is automatically generated that contains the name of this field. Every legend item is connected to an individual series on the chart, so if you add an Total as one of the legend value, it will also added as one part of the pie chart.

    I have tested on my local environment and I recommend you to display the total at the right of every legend value, we can do this by using the expression in the Custom legend text box to splice the amount value and the Total Amount together.

    Details steps below for your reference:

    1. Right click the Values Area to select the “Series Properties”
    2. Click Legend on the left pane in  the Series Properties window  and put this expression in the Custom legend text:
      =Fields!Legendfields.Value &  "-"  & Sum(Fields!AmountFields.Value) & "     Total -  "  &Sum(Fields!SalesAmount.Value,"DataSet1")
    3. Preview and it will display like this:

    Article about the Change the Text of a Legend Item for your reference:
    http://msdn.microsoft.com/en-us/library/dd220595.aspx

    If your problem still exists, please feel free to ask.

    Regards
    Vicky Liu

    Thursday, November 20, 2014 5:33 AM
    Moderator