Hi,
I worked through the example on creating a pie chart with a legend and it worked fine.
What I want to do is for the pie chart have the % value, but for the legend have the item + actual value.
So far instance, one slice may show "10%" on the pie chart, but on the legend show "Widget X - 255".
The legend seems tied to whatever is specified in the pie chart label member.
Is there a way to accomplish what I describe?
Hello Wai,
Thank you for your post. I have been looking into the question that you are having and I can suggest using the LegendItemTemplate property of the XamPieChart. Setting the LegentItemTemplate allows you to change the appearance of the items in the XamPieChart’s Legend. The DataContext for the DataTemplate used for the LegendItemTemplate is a PieSliceDataContext object (you can see the members of the class here: http://help.infragistics.com/doc/WindowsPhone/2012.2/CLR4.0?page=InfragisticsWP7.Controls.Charts.XamDataChart.v12.2~Infragistics.Controls.Charts.PieSliceDataContext_members.html) that contains a PercentValue property that returns the percentage value corresponding to the slice. Using that value you can show the percent values in the legend. I have created sample application for you, that shows how you can set the LegendItemTemplate.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir, MCPD
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Hi Krasimir,
This is awesome, thanks!
Is it possible to reference PercentValue in the LabelMemberPath instead?
It shouldn't be a real issue as I can calculate that value and apply it to my data object bound to the datacontext.
I got it working using the LabelTemplate. Thanks for all your help!
Thank you for your replies. I am very glad that you have managed to solve the issue that you were having. Please let me know if you need any further assistance on the matter.