In this article, I will be telling you all about the method using which you can generate the charts with the help of Silverlight Toolkit which is freely available for download from here.
Before starting the actual process, you must download the Silverlight 4 from here.
After installing the Silverlight 4 and the toolkit, Create a new project in Visual Studio 2010 of Silverlight and while creating a new project ensure that you check the enable WCF services option. ( This option is useful if you are using the WCF services for your project )
After creating a new project, add the following references to the project.
I am considering the sample data for the simple chart that we want to make. We create a new class as follows:
Now we have two variables CustName and Orders which are defined inside the MyClass Class. Our Chart will show the data about the Customer Name and Orders in the Line Chart. So using the following code sample,
Now we also have to change the MainPage.xaml file for the display purpose of the chart, refer the below code for the same:
We are generating the simple LineSeries Chart using the above code. If one wants to display a PieSeries, BubbleSeries, ScatterSeries, ColumnSeries or Series Like all the Stacked Series, then just change the LineSeries from the code and you are done for the respective series which are available in the Silverlight Toolkit. 🙂
After doing all this, just run the application and the following lineSeries will be generated :
So, there you are ready with all the Charts using the Silverlight Toolkit and those look awesome for your dashboard, aren’t they? 😉