ActiveReports 6 Online Help
Chart Control Items
Show AllShow All
Hide AllHide All

Annotations

The Chart control offers a built-in annotation tool to allow you to include floating text bars or images in your charts or call attention to specific items or values in your charts using the line and text bar controls included in the Annotation Collection Editor.

The following properties are important when setting up annotations for your chart:

The following code demonstrates creating annotation lines and text bars, setting their properties, and adding them to the series annotations collection at run time. The results are shown in the screen shot above.

  1. In design view of the report, double-click the section where you placed your chart. This creates a Format event handling method for the section.
  2. Add code to the handler to create annotation lines and text bars.

To write the code in Visual Basic.NET

To write the code in C#

Titles and Footers

The Chart control allows you to add custom titles to your charts. The Titles collection is accessible from the Chart object. With the ability to add as many titles as needed, dock them to any side of a chart area, change all of the font properties, add borders and shadows, make the background look the way you want it, and change the location of the text, you can easily make your titles look the way you want them to look.

The following code demonstrates creating header and footer titles, setting their properties, and adding them to the titles collection at run time.

  1. In design view of the report, double-click the section where you placed your chart. This creates a Format event handling method for the section.
  2. Add code to the handler to create header and footer titles.

To write the code in Visual Basic.NET

To write the code in C#

Legends

The Chart control automatically creates a legend item for each series added to a chart at design time and sets the Legend property for each series by default. However, the legend's Visible property must be set to True for the legend to show with the chart. The text for each default legend entry is taken from the Name property on the series.

The following code demonstrates how to create a legend at run time, add it to the legends collection for the Chart object and set the legend property of the series to the new legend, resulting in the legend shown above.

Note: Each Series to be shown in the Legend must have a Name. If the Name property is not set, the Series does not show up in the Legend.

  1. In design view of the report, double-click the section where you placed your chart. This creates a Format event handling method for the section.
  2. Add code to the handler to create a legend.

To write the code in Visual Basic.NET

To write the code in C#

Markers

Use markers to show specific data series values in a chart.

The following code demonstrates how to create a marker object at run time and assign it to the Marker property of the series. The results are shown in the image above.

  1. In design view of the report, double-click the section where you placed your chart. This creates a Format event handling method for the section.
  2. Add code to the handler to create a marker object and assign it to the series.

To write the code in Visual Basic.NET

To write the code in C#

Constant Lines and Stripes

The Chart control supports constant lines and stripes through the use of the WallRanges collection. It allows you to display horizontal or vertical lines or stripes in a chart to highlight certain areas. For example, you could draw a stripe in a chart to draw attention to a high level in the data or draw a line to show the average value of the data presented.

Important properties

The following code demonstrates how to create wall ranges, set their properties, and assign them to a chart area at run time. The results are shown in the image above.

  1. In design view of the report, double-click the section where you placed your chart. This creates a Format event handling method for the section.
  2. Add code to the handler to create wall ranges and assign them to a chart area.

To write the code in Visual Basic.NET

To write the code in C#

See Also

How To

Walkthroughs