Chart Legend Labels

I have a simple table that contains two columns that I would like to display in a pie chart. How can I display the X axis label in the chart legend rather than the data value?

I attached a simple project that I am using for testing. Thanks for any help.



PieChartTest_2ecdb964.rar

1 Reply

SA Saradha Syncfusion Team July 22, 2009 07:01 AM UTC

Hi Tom,

Thanks for your interest in Syncfusion products.

We could use the Legend ItemTemplate and show the X, Y or the label values in the legend items.

Please refer to the sample from the below given link that has a DataTemplate written for legend items
http://files.syncfusion.com/support/Chart.WPF/7.3.0.20/F88123/main.htm

In the DataTemplate DataPoint.Item is used to show the labels. Here you could also use DataPoint.X, or Y.



This DataTemplate is assigned to the legend in VB file as shown below.
objLegend.ItemTemplate = TryCast(Me.Resources("LegendTemplate"), DataTemplate)

Please let us know if you have further queries.

Regards,
K. Saradha Devi

Loader.
Up arrow icon