This is a migrated thread and some comments may be shown as answers.
Chart pie: series' labels
4 Answers 77 Views
This is a migrated thread and some comments may be shown as answers.
Ilaria
Top achievements
Rank 1
Ilaria asked on 09 Mar 2011, 11:16 AM
Hello!
I've got a chart with two pie series. I need to know if it's possible to show a label for each series over each pie.

Thanks a lot.
Ilaria

4 Answers, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 11 Mar 2011, 03:19 PM
Hi Ilaria,

By default Series show the YValues of the Chart as Series Items labels as shown in our demo. You can use the DataLabelsColumn property of the Series to bind the custom Label for each Slice.

Regards,
Evgenia
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Michele
Top achievements
Rank 2
answered on 18 Mar 2011, 10:51 AM
Hello Evgenia,
what Ilaria means is if it's possible to have something as I've attached in the image below in the PIE definition without having to add two textbox over it the pies

Thanks
0
Evgenia
Telerik team
answered on 22 Mar 2011, 01:34 PM
Hi Paolo,

Thanks for the image attached and for the explanation. I can suggest you two ways to achieve what you need. It's up to you to decide which one to use:

1. Use the Chart Legend and set custom Name for each ChartSeries (in your case each Pie). This way the Name will be displayed as Chart Legend Item like this:
<telerik:RadChart ID="RadChart1" runat="server">
          <Series>
              <telerik:ChartSeries Name="Pie 1" Type="Pie">
              </telerik:ChartSeries>
              <telerik:ChartSeries Name="Pie 2" Type="Pie">
              </telerik:ChartSeries>
          </Series>
      </telerik:RadChart>

2. Use the Chart Title and set the text for the two Pies there (see the attached image showing the result):
 
<telerik:RadChart ID="RadChart1" runat="server">
            <Series>
                <telerik:ChartSeries Name="Pie 1" Type="Pie">
                </telerik:ChartSeries>
                <telerik:ChartSeries Name="Pie 2" Type="Pie">
                </telerik:ChartSeries>
            </Series>
            <ChartTitle TextBlock-Text="Pie 1                 Pie 2" />
        </telerik:RadChart>

Kind regards,
Evgenia
the Telerik team
0
Scott
Top achievements
Rank 1
answered on 18 May 2011, 10:09 PM

I have accomplished adding multiple labels (both x and y axis) to a pie chart using the following code behind.  In this example, my table has two columns named Status and Records.  See attached.  Hope this helps...

 

 

Private Sub RadChart59_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Charting.ChartItemDataBoundEventArgs) Handles RadChart59.ItemDataBound

        Dim item As Telerik.Charting.ChartSeriesItem = e.SeriesItem

        Dim dataItem As Data.DataRowView = CType(e.DataItem, Data.DataRowView)

        item.Label.TextBlock.Text = RTrim(dataItem("Status").ToString) + " - " + RTrim((dataItem("Records").ToString))

End Sub

 

 

Asked by
Ilaria
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Michele
Top achievements
Rank 2
Scott
Top achievements
Rank 1
Share this question
or