Chart pie: series' labels

Thread is closed for posting
5 posts, 0 answers
  1. Ilaria
    Ilaria avatar
    3 posts
    Member since:
    Jan 2011

    Posted 09 Mar 2011 Link to this post

    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
  2. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 11 Mar 2011 Link to this post

    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!
  3. Michele
    Michele avatar
    426 posts
    Member since:
    Jun 2009

    Posted 18 Mar 2011 Link to this post

    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
  4. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 22 Mar 2011 Link to this post

    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
  5. Scott
    Scott avatar
    5 posts
    Member since:
    Dec 2010

    Posted 18 May 2011 Link to this post

    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

     

     

Back to Top