IntroductionIn this article, I'm going to explain that how to create chart control using XAML in Windows Phone 7.In addition, bind data from the XML to chart control. the above figure is sample output in the out of the mobile screen. The below is actual screen on the mobile phone. Windows Phone 7 Provide you great Support of Data Visualization with Charts and Vector graphic. You can also bind chart with xml data by using mvvm pattern.
To Create Chart Control with XML.
1 Open Visual Studio 2010 then create new Silverlight windows Phone Project 2 Add XML file and define some schema. Add XML source file that we are going to use bind to chart control. 3. 3 Add three Folders in Solution "Model", "View" , "ViewModel" 4 Add Class in Model name ResultView.cs and map your xml scheme with properties. 5 Add Class in ViewModel and Named ResultViewModel.cs in this class you load data from xml. 6 Open App.xaml and define or copy from sample code in you Template for PhoneChart Portrait and Landscape orientation in ResourceDictionary. 7 Add one UserControl in your View Folder and named ResultView.xaml. 8 Open MainPage.xaml add View in it. 9 Open MainPage.xaml and Override the OnOrientationChanged event handler and change template on On Orientation. 10. That's all now press F5 and see the output in your window phone. Download Source Code Download source files -978 kb SummaryThis is another part of my article series, I hope you also like it. Thank you for reading. |