Smart Label on Pie Chart

2 posts, 0 answers
  1. Rupert Henson
    Rupert Henson avatar
    8 posts
    Member since:
    Jul 2009

    Posted 15 Mar 2010 Link to this post

    Hi,

    I'm using the latest release version (Q1 2010) but I'm having no luck in getting the item labels to avoid overlapping each other in the Pie Chart.

    I notice that the telerik demo application does not really demonstrate Smart Labels for the piechart, as all the data items are nicely spaced numerically.....

    I've included my simple example code (with just a plain RadChart named "RadChart1" in the XAML side of this).

    The pie chart produced has the values for years 2005 and 2006 overlapping each other, but I thought that the new Smart Labels Enabled option would try its best to avoid this.

    Regards,

    Rupert.

    Partial

     

    Public Class MainPage

     

     

    Inherits UserControl

     

     

    Public Sub New()

     

    InitializeComponent()

    RadChart1.DefaultSeriesDefinition =

    New PieSeriesDefinition()

     

    RadChart1.DefaultView.ChartArea.SmartLabelsEnabled =

    True

     

     

    Dim s As New SeriesMapping()

     

    s.ItemMappings.Add(

    New ItemMapping("ValueY", DataPointMember.YValue))

     

    s.ItemMappings.Add(

    New ItemMapping("Category", DataPointMember.LegendLabel))

     

    s.ItemMappings.Add(

    New ItemMapping("Category", DataPointMember.Label))

     

    RadChart1.SeriesMappings.Add(s)

     

    Dim objDataSource As New List(Of CategoryValue)

     

    objDataSource.Add(

    New CategoryValue() With {.Category = "2005", .ValueY = 2})

     

    objDataSource.Add(

    New CategoryValue() With {.Category = "2006", .ValueY = 2})

     

    objDataSource.Add(

    New CategoryValue() With {.Category = "2007", .ValueY = 500})

     

    RadChart1.ItemsSource = objDataSource

     

    End Sub

     

    End

     

    Class

     

    Public

     

    Class CategoryValue

     

     

    Private _Category As String

     

     

    Private _ValueY As Double

     

     

    Public Property Category() As String

     

     

    Get

     

     

    Return _Category

     

     

    End Get

     

     

    Set(ByVal value As String)

     

    _Category = value

     

    End Set

     

     

    End Property

     

     

    Public Property ValueY() As Double

     

     

    Get

     

     

    Return _ValueY

     

     

    End Get

     

     

    Set(ByVal value As Double)

     

    _ValueY = value

     

    End Set

     

     

    End Property

     

    End

     

    Class

     

  2. Velin
    Admin
    Velin avatar
    391 posts

    Posted 17 Mar 2010 Link to this post

    Hi Rupert Henson,

    Currently, the automatic label positioning algorithm works with radial series only when spider mode is enabled. This behavior will probably be improved in the upcoming versions of the control.

    Best wishes,
    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.
Back to Top