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