combining legend and labels in pie chart
hi,
is it possible to combine legend and labels in pie chart?
my pie chart has a percentage labels. and as usual, the legend shows under the chart or where ever you want to put the legend.
is it possible to combine it together? ie. "50% Product A", "25% Product B", and so on.
regards,
AddinAddinGanteng
May 14th, 2011 2:48am
Hi,
Yes it is possible. I have tried a simple pie chart which shows order quantity countrywise in Adv Works DB.
In the Series Group properties you can add an expression similar to this
CSTR(SUM(Fields!OrderQty.Value)) & " " & Fields!Country.Value
The result was 19728 Australia
HTH,
Ram
Free Windows Admin Tool Kit Click here and download it now
May 14th, 2011 3:05am
Hi,
thanks for your response.
my expression is: =(Fields!Area.Value / reportitems!AllArea.Value) & " " & Fields!Product.Value
no error occurred, but the chart wasn't shows upAddinGanteng
May 14th, 2011 4:38am
Hi,
Since you are concatenating a numeric value with a string make sure you convert the numeric value to string and then concatenate.
HTH,
Ram
Free Windows Admin Tool Kit Click here and download it now
May 14th, 2011 5:24am
Hi,
You could do one more thing. You could try the same expression by writing it in the Legend Properties uner the Series Section.
Here is what I did
1) Right click on the chart area where you have placed the measure value and select series properties.
2) Inside that you have the "Legend" Section
3) Click on Legend and under "Custom Legend Text" Try typing the expression as
=CSTR(Round((Fields!Area.Value / reportitems!AllArea.Value),0)) & " " & Fields!Product.Value
and then run the report.
This should work for you.
HTH,
Ram
May 14th, 2011 6:31am
Hi,the expression only works on legend,not on the series properties,and not using cstr Here's what I do: 1. Right click on any area of the chart and choose Series Properties 2. On series data menu,a typed in the value field to: =cstr((fields!area.value
/ fields!allarea.value) * 100) & " " & fields!product.value 3. Run the report,nothing showed up Then I tried it to remove the expression from series (using the default area/allarea) and on Legend expression,I typed this: =(fields!area.value / fields!allarea.value)
* 100 & " " & fields!product.value The chart did shows up. The legend writes exactly what I want ie. 35.5 Chocolate But when I typed the same expression into the series,chart won't shows up,using cstr or not.AddinGanteng
Free Windows Admin Tool Kit Click here and download it now
May 14th, 2011 9:09am
Hi,the expression only works on legend,not on the series properties,and not using cstr Here's what I do: 1. Right click on any area of the chart and choose Series Properties 2. On series data menu,a typed in the value field to: =cstr((fields!area.value
/ fields!allarea.value) * 100) & " " & fields!product.value 3. Run the report,nothing showed up Then I tried it to remove the expression from series (using the default area/allarea) and on Legend expression,I typed this: =(fields!area.value / fields!allarea.value)
* 100 & " " & fields!product.value The chart did shows up. The legend writes exactly what I want ie. 35.5 Chocolate But when I typed the same expression into the series,chart won't shows up,using cstr or not.AddinGanteng
May 14th, 2011 9:09am
Hi,
Ok I got it ! I have one more option. If you could do these calculation in your dataset query and refer the field in the report it would work for you. Instead of doing the calculation at report level, i think if you can achieve it in the dataset query
level itself it would solve your problem !
HTH,
Ram
Free Windows Admin Tool Kit Click here and download it now
May 14th, 2011 9:50am
Hi,
Ok I got it ! I have one more option. If you could do these calculation in your dataset query and refer the field in the report it would work for you. Instead of doing the calculation at report level, i think if you can achieve it in the dataset query
level itself it would solve your problem !
HTH,
Ram
May 14th, 2011 9:50am
I've tried to create new dataset,even hard code it on the query level,but still it won't showed up. I think that series label can not contains stringAddinGanteng
Free Windows Admin Tool Kit Click here and download it now
May 14th, 2011 10:04am
I've tried to create new dataset,even hard code it on the query level,but still it won't showed up. I think that series label can not contains stringAddinGanteng
May 14th, 2011 10:04am
Hi Addin,
It is possible. For example, if the dataset contains 2 data fields Category and OrderQuantity, the Category field is specified to the Category Group of the chart and the OrderQuantity
is specified to the chart data value, please refer to the steps below:
1.
Right click the chart and enable the option “Show Data Labels”.
2.
Right click the data label and select Series Label Properties…
3.
In the Label data dropdown list, specify the expression like
=Round(Sum(Fields!OrderQuantity.Value) / Sum(Fields!OrderQuantity.Value,
"DataSet1")*100,2) &
"% " & Fields!Category.Value
After that, both percentage label and legend will be displayed on the chart.
Regards,
Tony Chain
Tony Chain [MSFT CSG] | Microsoft Community Support
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Free Windows Admin Tool Kit Click here and download it now
May 20th, 2011 2:59am