We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Chart Legend Labels

Thread ID:

Created:

Updated:

Platform:

Replies:

88123 Jul 15,2009 03:29 PM Jul 22,2009 03:01 AM ASP.NET Web Forms (Classic) 1
loading
Tags: Chart
Tom Foley
Asked On July 15, 2009 03:29 PM

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

Saradha [Syncfusion]
Replied On July 22, 2009 03:01 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;