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

Pie Chart Series Item Lebel Issues

1 Answer 18 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 19 Jan 2011, 06:15 PM
I have a pie chart that displays everything that I want it to, however I can not get the label to show BOTH the number from the column, and the percentage of the chart.

This shows the number correctly:
Protected Sub RadChart1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Charting.ChartItemDataBoundEventArgs) Handles RadChart1.ItemDataBound
 
        e.SeriesItem.Label.TextBlock.Text = TryCast(DirectCast(e.DataItem, DataRowView)("number"), String)
 
    End Sub

This shows the percentage correctly:
e.SeriesItem.Label.TextBlock.Text = " - #%"

But this does NOT show both, it only shows the percentages still...
e.SeriesItem.Label.TextBlock.Text = TryCast(DirectCast(e.DataItem, DataRowView)("number"), String) + " - #%"

Is there a way to display both?

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 25 Jan 2011, 08:07 AM
Hi Shawn,

Could you confirm that your RadChart is databound as the code snippet you provided will work only in this case.
Another way to achieve this is to use the DefaultLabelValue like this:
RadChart1.Series[0].DefaultLabelValue = "#Y - #%";

Greetings,
Evgenia
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Chart (Obsolete)
Asked by
Shawn
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or