ComponentOne Chart for WPF and Silverlight
Chart for WPF and Silverlight / Getting Started / Quick Start / Step 1 of 4: Adding Chart to Your Project
In This Topic
    Step 1 of 4: Adding Chart to Your Project
    In This Topic

    In this step you'll begin in Visual Studio to create a chart application using Chart for WPF and Silverlight. When you add the C1Chart control to your Visual Studio project, you’ll have a functional column chart with fake data. 

    Complete these steps:

    1. Create a new WPF or Silverlight application in Visual Studio.
      1. Select File | New | Project. The New Project dialog box will open.
      2.  In the New Project dialog box, select a language in the left-hand pane, and then select a template:
        1. For WPF, select Windows Desktop. Then, select WPF Application from the list of applications in the center pane.
        2. For Silverlight, select Silverlight. Then, select Silverlight Application from the list of applications in the center pane.
      3. Give your application a Name, and then select OK. Your application will open.
    2. Add references to your application by right-clicking the Reference folder and selecting Add Reference. The Reference Manager will open.
      1. Browse to locate the appropriate references for your project.
        1. For a WPF application, add the following reference:
          • C1.WPF.Chart.4.dll
        2. For a Silverlight application, add the following reference:
          • C1.Silverlight.Chart.5.dll
    3. Add the following namespace declaration to your <Window> or <UserControl> tag. This will allow you to add chart data later in this project if you're working in XAML markup.
    XAML
    Copy Code
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    
    1. Place your cursor between the <Grid> </Grid> tags within either your Window or your UserControl, depending on the type of application you're creating.
    2. Locate the C1Chart control in Visual Studio's ToolBox. Double-click  the control to add it to your application. The XAML markup will resemble the following:
    XAML
    Copy Code
    <Grid x:Name="LayoutRoot">
    <c1chart:C1Chart></c1chart:C1Chart>
    </Grid>
    
    1. Give your chart a name so that you can call it in code later. Your markup will resemble the following sample:
    XAML
    Copy Code
    <c1chart:C1Chart Margin="0,0,8,8" MinHeight="160" MinWidth="240" Name="c1Chart1">
    </c1chart:C1Chart>
    

    What You've Accomplished

     You've successfully created a WPF or Silverlight application containing a C1Chart control. In the next step, you will Step 2 of 4: Adding Data to the Chart, you will add the data for C1Chart

     

    See Also