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.Silverlight.C1Chart namespace directive

      Visual Basic

      C#

3.   Add the following code in the constructor Window1 class to create the Bar chart:

      Visual Basic

      C#

In the next step, Step 3 of 4: Format the Axes, you’ll learn how to customize the axes programmatically

What You’ve Accomplished

You have successfully added data to C1Chart 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.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.