Before reading this article, please go through the article's link, given below-
- Introduction To Universal Windows Platform (UWP) App Development Using Windows 10 And Visual Studio 2015
Reading this article, you can learn how to create column chart in Universal Windows apps development with XAML and Visual C#.
The following important tools are required for developing UWP-
- Windows 10 (Recommended)
- Visual Studio 2015 Community Edition (It is a free software available online)
Now, we can discuss step by step app development.
Step 1- Open Visual Studio 2015 -> Start -> New Project-> Select Universal (under Visual C#->Windows)-> Blank app -> Give the suitable name for your app (ColumnUWP)->OK. Choose the Target and minimum platform version for your Windows Universal Application will support. Afterwards, the project creates App.xaml and MainPage.xaml.
Step 2- Open (double click) the file MainPage.xaml in the Solution Explorer and add the WINRT XAML Tool Kit Control reference in the project.
For adding the reference, right click on your project (ColumnUWP) and select Manage NuGet Packages.
Choose Browse and search WinRTXamlToolkit.Controls.DataVisualization.UWP, select the package and install it.
Add TextBlock control, change the name and text property.
Step 3 - Add the charting namespace and Line series control code in the XAML View.
Step 4 - Add the name space, given below and class in MainPage.xaml.cs.
Step 5- Add the Method GetChartData() in MainPage.xaml.cs. This code is used for setting the values for your ColumnChart and call the GetChartData() method in the constructor method (MainPage() method) in MainPage.xaml.cs.
Step 6 - Deploy your app in Local Machine and the output of the ColumnUWP app is given below-
Summary
Now, you have successfully created and tested the column chart in Visual C# - UWP environment.