Lets put in the code that actually draws the pie chart in the chart control.
To show the data in our Pie Chart, we need the WCF to service reference in our Silverlight project, to do that right click on the refereces folder in the Silverlight project “PieChart” and click on “Add Service Reference”.
Below is the window, that adds service reference to our silverlight project.
Click on “Discover” and it will find our WCF service, and make sure you have the method on the right under “Operations”. Click on OK to add the WCF as Service reference to our Silverlight Project.
You can give any name to your service reference like anything related, but as this is just one Service reference I am just going by default name “ServiceReference1”.
So now make the following changes to your MainPage.xaml
Now build your project, goto Build\Build Solution, and run the program, go to
Debug\Start Without Debugging (Ctrl+F5)
It runs the program and you will get an output like below
Click on Generate Button and the final output will be below
To See all parts for Pie Chart in Silverlight with WCF, please click on the link to the right that says it.
You can download the final version of the project and full version of the post in a word document in the final part of this post.
Please do comment or leave any suggestions or questions below, I will reply immediately. You may also leave any requests for new posts.
Thank you, See you soon with a new post.
Hi Vijay.I'm really thankful that u'r putting u'r effort for posting some important topics.It would be really gr8 if u post a few on WPF and some on threading with example.Thanks in advance
ReplyDeleteHi Kiran, sure will love to do that .
ReplyDeleteShall i post the same charting app in WPF or do something different? Let me know your ideas and how you wanted to see
....Vijaya Malla