Introduction
In this article we will explore on Pie Chart in Silverlight 3. Pie Chart comes with Silverlight 3 Toolkit.
Crating Silverlight Project
Fire up Expression Blend 3 and create a Silverlight Application. Name it as PieChartInSL3.

Go ahead and add a Pie Series into your application.
You can find it in Asset Library.

By adding a Pie Series, you just added an Assembly System.Windows.Controls.DataVisualization.
And Blend automatically refers to the Namespace.
If you see the xaml code behind you will find the following:
xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
Now we will add some data into it.
Create a class called Appointment and add the following code into it.
public class Appointment
{
public int Id { get; set; }
public string AppName { get;
set; }
public string AppointmentDetails { get;
set; }
public int Duration { get; set; }
public
Appointment()
{
}
public
Appointment(int id, string
appName, string appointmentDetails, int duration)
{
Id = id;
AppName = appName;
AppointmentDetails = appointmentDetails;
Duration = duration;
}
}
Pie Series takes Key Value pair as it's data. So we will create a class named AppointmentHelper which will convert a Dictionary to Key Value Pair.
public static Dictionary<String, int>
GetTimeDistribution(this List<Appointment>
appts)
{
Dictionary<String, int>
myTimeDistribution = new Dictionary<string,
int>();


Anindita BasakPosted Jan 8, 2011, 6:21 AM
nice article ..
Norwill GutierrezPosted Aug 12, 2010, 6:01 PM
thanks a lot, i doit a litles change to your sample and post in my blog. http://developergutierrez.wordpress.com/
tofu LetteeditedPosted Nov 7, 2009, 4:08 AMEdited Nov 7, 2009, 4:09 AM
Thank you very much. This is the first example i found that works and is easy to understand. You saved my day!!
SanjiveditedPosted Aug 27, 2009, 4:44 PMEdited Aug 27, 2009, 5:24 PM
How do I get dynamic values to be displayed in SL3.0 chart either within the pie sections or around it? The data set we have is dynamic. Thanks.