Chart for WinRT
Step 2 of 4: Adding Data to the Chart

In the last step, you added the C1Chart control to the Window. In this step, you will add a DataSeries object and data for it.

To add data to the chart programmatically in the code behind file:

  1. Right-click on the MainPage.xaml file and select View Code to open the editor.
  2. Add the C1.Xaml.C1Chart namespace directive:

To write the code in Visual Basic:

To write the code in C#:

  1. Add the following Page_Loaded_1 event handler with code to create the Bar chart:

To write the code in Visual Basic:

To write the code in C#:

What You've Accomplished

You have successfully added data to C1Chart control so when you run your application the string values appear on the Y-axis like the following:

In the next step you will add a ChartView object so you can customize the X-Axis.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback