Category "Labels" not displaying on Pie Chart


https://www.nevron.com/Forum/Topic9503.aspx
Print Topic | Close Window

By Steve Murray - 9 Years Ago

I am unable to pass the "Label" from a Category Data Grouping.  I am grouping by Category to distinguish costs:
Labels are "Less than 20 OMR", "Between 20 and 35 OMR" and "Greater than 35 OMR".  The logic for each of the Category groupings is working fine e.g. (=Fields!Total_Current_Charges<20) and displays the <value> and <percent>, but the Label I assign to each Category grouping does not get passed back to the chart.  Below is a screenshot of my configuration.
Thanks in advance!
https://www.nevron.com/forum/uploads/images/9a1ef547-9751-418d-867a-0309.png

By Nevron Support - 9 Years Ago
You can’t pass category labels to the pie chart data labels like that. Also, you should not use the FORMAT function in the Data -> Value field.

You should consider using only <label> in the Data Groupings -> Values -> Data Labels -> Format field:
https://www.nevron.com/forum/uploads/images/50c2b1b8-5a29-4729-a2aa-8ca7.png

Then, in the Data Groupings -> Values -> General -> Data -> Label field, use an expression like this:
=IF(Fields!Total_Current_Charges<20, "Less than 20 OMR",
IF(Fields!Total_Current_Charges>35, "Greater than 35 OMR", "Between 20 and 35 OMR")) + " - " +
FORMAT(SUM(Fields!GrossProfit.Value), "N0", "en-us") + " - " +
FORMAT((SUM(Fields!GrossProfit.Value)/SUM(Parent.Fields!GrossProfit.Value)), "P0", "en-us")

https://www.nevron.com/forum/uploads/images/872ad22b-5009-49e6-b3eb-62b5.png
By Steve Murray - 9 Years Ago
https://www.nevron.com/forum/uploads/images/2f8fa153-2f6d-460a-9f2a-2f0b.pngThanks for your prompt reply.  I made the recommended changes (screenshot of two Format statements); but now giveshttps://www.nevron.com/forum/uploads/images/91222ba0-a7d1-4172-84c4-5645.png me an error.

By Nevron Support - 9 Years Ago
This is because the expression returns an array. Can you send a snapshot of your data - the field of interest is the "Total_Current_Charges".

Since you have category grouping, you may need to update your expression with FIRST for the Total_Current_Charges e.g.:

=IF(FIRST(Fields!Total_Current_Charges)<20, "Less than 20 OMR",
IF(FIRST(Fields!Total_Current_Charges)>35, "Greater than 35 OMR", "Between 20 and 35 OMR")) + " - " +
FORMAT(SUM(Fields!GrossProfit.Value), "N0", "en-us") + " - " +
FORMAT((SUM(Fields!GrossProfit.Value)/SUM(Parent.Fields!GrossProfit.Value)), "P0", "en-us")
By Steve Murray - 9 Years Ago
Thanks.... I tried your "First" suggestion.... no joy.  I have attached a snapshot and a copy of November's data (minus cell number, department, name.)  Appreciate your help.https://www.nevron.com/forum/uploads/images/68bc81a7-2c07-46b9-ac0a-80a8.png
By Steve Murray - 9 Years Ago
https://www.nevron.com/forum/uploads/images/92a74520-af5e-42ef-88bc-c768.pngNo joy yet.  Attached is the requested information.
https://www.nevron.com/forum/uploads/images/d827c257-383e-486e-9d54-208b.png
By Steve Murray - 9 Years Ago
https://www.nevron.com/forum/uploads/images/f0eabcc0-a23a-4cc6-b360-f0c2.pngStill no joy yet.... This seems to be a pretty straight forward chart; however, I am unable to "pass" the filter criteria labels to either the Legend or the pie chart Data Labels. 
Copy of chart w/o labels and logic.https://www.nevron.com/forum/uploads/images/27601ef9-2a2d-4a9f-8445-f29f.png
By Steve Murray - 8 Years Ago
https://www.nevron.com/forum/uploads/images/44c53323-f2ca-4c43-aa25-a51d.pngI am still not able to pass labels to the Label: or the Legend.
Expression appears to work correctly as the percentages are correct. Below is the expression and a picture of the chart.
https://www.nevron.com/forum/uploads/images/b0aa5025-0fe7-4515-b350-94da.png
By Nevron Support - 8 Years Ago
Steve,
Can you send a snapshot of your data (in Excel spreadsheet). We are going to prepare an example for you.
By Steve Murray - 8 Years Ago
Attached is Jan/Feb data from Sharepoint list.  When creating a chart, I set a filter for Iphone charges. 
Thanks for the helping hand(mind)!
By Nevron Support - 8 Years Ago
Hello Steve,
Thank you for providing the sample data. Following is the resulting Pie chart:
https://www.nevron.com/forum/uploads/images/dd0e3917-9f42-48b1-a7ab-01c7.png

Attached, you can also find the chart template file.
Let us know if you have any questions or if you need assistance.
By Steve Murray - 8 Years Ago
Good news!  Chart is working properly.  Still don't know how to make the Labels appear on two lines.  Many thanks for your help.  You guys are awesome!https://www.nevron.com/forum/uploads/images/c5e91088-e6de-4e90-8812-11b7.png
By Nevron Support - 8 Years Ago
Hi Steve,
We are glad that we were able to help.
To have the labels on two, or multiple lines, you simply need to break the line in the expression editor like this:
=IF(FIRST(Fields!Total_Current_Charges)<20, "Less than 20 OMR",
IF(FIRST(Fields!Total_Current_Charges)>35, "Greater than 35 OMR", "Between 20 and 35 OMR")) + "
" +
FORMAT(SUM(Fields!Total_Current_Charges), "N0", "en-us") + "
" +
FORMAT((SUM(Fields!Total_Current_Charges)/SUM(Parent.Fields!Total_Current_Charges)), "P0", "en-us")
By Steve Murray - 8 Years Ago
That was too easy!  I wish the online documentation said "How to obtain 2 or 3 line labels" on your charts.  In the expression editor for Data Labels, press enter and add a second line.  I looked everywhere in the online documentation.  Off and running, thanks!