This is a migrated thread and some comments may be shown as answers.

Legends of the RadChart

2 Answers 122 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Arvind
Top achievements
Rank 1
Arvind asked on 03 Aug 2010, 11:03 AM
Hi,
   In RadChards, is it possible to display the legends as given in the attached screen shot?  I generated this from the excel.  I tried to generate the same using RadChart.  But I am not able to get the legends as in the attached screen shot.  

   Please advice. 

   Thank you for your help.

Regards,
Arvind Robin Kumar.

2 Answers, 1 is accepted

Sort by
0
Accepted
Velin
Telerik team
answered on 06 Aug 2010, 03:54 PM
Hi Arvind,
Here is some sample code that should help:
    ChartSeries s1 = new ChartSeries("1", ChartSeriesType.Pie);
    s1.DataYColumn = "Y";
    s1.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.ItemLabels;
 
    RadChart1.ItemDataBound += new EventHandler<ChartItemDataBoundEventArgs>(RadChart1_ItemDataBound);
 
void RadChart1_ItemDataBound(object sender, ChartItemDataBoundEventArgs e)
{
    e.SeriesItem.Name = "TEST";
}


Sincerely yours,
Velin
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Arvind
Top achievements
Rank 1
answered on 09 Aug 2010, 09:26 AM
Hi Velin,
    I added the following code and it is working fine now. 

 

private void radChart1_ItemDataBound(object sender, Telerik.Charting.ChartItemDataBoundEventArgs e)

 

{

 

DataRowView dataItem = (DataRowView)e.DataItem;

 

 

if (dataItem != null)

 

{

e.SeriesItem.Name =

Convert.ToString(dataItem["LegendName"]);

 

}

}


Regards,
Arvind Robin Kumar.
Tags
Chart (obsolete as of Q1 2013)
Asked by
Arvind
Top achievements
Rank 1
Answers by
Velin
Telerik team
Arvind
Top achievements
Rank 1
Share this question
or