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

Data Label Problem

1 Answer 99 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Sunil
Top achievements
Rank 1
Sunil asked on 31 Jul 2008, 07:19 AM
Hi,

I'm using a Rad Chart (pie) for a small datasource.
The dataset looks like this:
Month          Sales in %           
Jan                 30
Feb                40
Mar                40

I have used datalabelcolumn property of the series and I initialised it to the Month then also it is displaying 30 40 40 to the next of slides  

Now i want to display the chart  with labels

 Jan       Feb   Mar
 30 %    40%  40%

With every pie slice and I want those to wrapped and formated as I have given.

Kindly help me.

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 31 Jul 2008, 10:36 AM
Hello Sunil,

You can wire ItemDataBound event and modify the labels as per your requirements. Here is an example:

protected void RadChart1_ItemDataBound(object sender, Telerik.Charting.ChartItemDataBoundEventArgs e) 
    { 
        e.SeriesItem.Label.TextBlock.Text = (e.DataItem as DataRowView)["Month"].ToString(); 
        e.SeriesItem.Label.TextBlock.Text += '\n'; 
        e.SeriesItem.Label.TextBlock.Text += e.SeriesItem.YValue + " %"
    } 

Hope this helps.

Regards,
Ves
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Chart (Obsolete)
Asked by
Sunil
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or