Glossary Item Box

ActiveReports for .NET 2 Online Help Send feedback to Data Dynamics

Simple Unbound Chart

The Chart control allows you to bind charts to any type of data source, including arrays. You can create a chart without setting its data source then load the data into the control at run time.

This walkthrough illustrates how to create a simple unbound chart.

The walkthrough is split up into the following activities:

To complete the walkthrough, you must have access to the NorthWind database (Nwind.mdb).

When you have finished this walkthrough, you will have a report that looks similar to the following.

Creating a new Visual Studio project

To create a new Visual Studio project

  1. Open Visual Studio.
  2. Click on File > New > Project.

  3. Select the project type and click on Windows Application.
  4. Change the name of your project and click OK.

Adding an ActiveReport to a Visual Studio project

To add an ActiveReport to your project

  1. Open a new project in Visual Studio.
  2. Click on Project > Add New Item.
  3. Select ActiveReports file and rename the file rptUnboundChart.
  4. Click Open.

Adding the chart control to the report

To add a chart control to the report

  1. Click the Charting control in the ActiveReports toolbox, draw it onto the report surface, and set the size property to 6, 4 in.
  2. Rename the chart control chtUnbound.
  3. With chtUnbound highlighted, click the Customize... hyperlink below the Properties Window. This brings up the Chart Designer dialog box. 
  4. Click the Series button on the left side, and delete Series1, Series2, and Series3.
  5. Click the Titles button on the left side of the Chart Designer.
  6. Type Unbound Chart in the Header Title and increase the font size to 14.
  7. Delete the Footer Title.
  8. Click the ChartAreas button on the left side of the wizard, and expand the Axes button.
  9. Click AxisX to select it, and type Company Name in the AxisX Title and increase the font size to 12.
  10. Click AxisY to select it, and type Freight in US$ in the AxisY Title and increase the font size to 12.
  11. Click the Legends button on the left side of the Chart Designer.
  12. Uncheck the Visible check box at the top.
  13. Click Finish.

Adding code to connect the chart to a data source

To write the code in Visual Basic

To write the code in C#

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.