ActiveReports 10
Financial Chart
ActiveReports 10 > ActiveReports User Guide > Samples and Walkthroughs > Walkthroughs > Section Report Walkthroughs > Chart > Financial Chart

Financial charts are useful for displaying stock information using High, Low, Open and Close values. This walkthrough illustrates how to create a Candle chart.

The walkthrough is split up into the following activities:

When you complete this walkthrough you get a layout that looks similar to the following at design time and at runtime.

To add an ActiveReport to the Visual Studio project

  1. Create a new Visual Studio project.
  2. From the Project menu, select Add New Item.
  3. In the Add New Item dialog that appears, select ActiveReports 10 Section Report (code-based) and in the Name field, rename the file as FinancialChart.
  4. Click the Add button to open a new section report in the designer.

See Adding an ActiveReport to a Project for information on adding different report layouts.

To add the Chart control to the report

  1. From the toolbox, drag the ChartControl to the body of the report.
  2. If the chart wizard appears, click Cancel.
    Tip: If you do not want the chart wizard to appear each time you add a chart, clear the Auto Run Wizard checkbox. You can still access the wizard via the command verbs (see below).
  3. In the Properties window, set the following properties.
    Property Name Property Value
    Location 0, 0in
    Size 6.5, 3.5in
  4. In the Report Explorer, select Detail1 and go to the properties window to set the Height property to 3.5.On the design surface, select the grey area outside the report and in the Properties window, set the PrintWidth property to 6.5.

To add a series and data points to the Chart

  1. With the chart control selected, go to the Properties window and click the Series (Collection) property and then click the ellipsis button.
  2. In the Series Collection Editor that appears, Series1 is selected by default. There, under Series1 properties, change the following.
    Property Name Property Value
    Type Candle
    Properties>BodyDownswingBackdrop (Default)
    Properties>BodyDownswingBackdrop>Color Fuchsia
    Properties>BodyUpswingBackdrop (Default)
    Properties>BodyUpswingBackdrop>Color DarkViolet
    Properties>BodyWidth 5
    Properties>WickLine (Default)
    Legend (none)
  3. Click the Points (Collection) property, then click the ellipsis button that appears. 
  4. In the DataPoint Collection window that appears, click Add to add a data point and set its YValues property to 99; 37; 53; 88.
    Note: The first Y value is the high figure or top of the wick; the second is the low figure, or bottom of the wick; the third is the opening figure; the fourth is the closing figure.  If the fourth figure is higher than the third, the candle is DarkViolet, the BodyUpswingBackdrop.
  5. Click Add to add another data point and set its YValues property to 115; 22; 101; 35.
  6. Click Add to add another data point, and set its YValues property to 87; 1; 7; 80.
  7. Click Add to add another data point, and set its YValues property to 63; 14; 57; 25.
  8. Click Add to add another data point, and set its YValues property to 130; 25; 25; 120.
  9. Click OK to save the data points and close the window.
  10. In the Series Collection Editor under Members, select Series2 and Series3 and click the Remove button.
  11. Click OK to return to the report design surface.

To configure the appearance of the Chart

 

  1. With the chart control selected, go to the Properties window and click the ChartAreas (Collection) property and then click the ellipsis button that appears.
  2. In the ChartArea Collection Editor that appears, under defaultArea properties, click the Axes (Collection) property, then click the ellipsis button that appears.
  3. In the AxisBase Collection Editor that appears, set the following properties.

    AxisBase

    1. Under AxisX properties, in the Title property delete the default text.
    2. Click the Labels (Collection) property, then click the ellipsis button that appears. This is where you add the labels that appear along the X axis, the line across the bottom of the chart.
    3. In the Array Data Editor that appears, enter the following into the editor, each item on a separate line:
      • Monday
      • Tuesday
      • Wednesday
      • Thursday
      • Friday
    4. Click the OK button to return to the AxisBase Collection Editor. 
    5. Under Members, select the AxisY member, and under AxisY properties set the following properties. 
      Property Name Property Value
      MajorTick>Step 10
      LabelsVisible True
      Min 0
      Title $,000
    6. Click OK to return to the ChartArea Collection Editor.
  4. Click OK to return to the report design surface and see the changes reflected in the chart.
  5. With the chart control selected, go to the Properties window and click the Titles (Collection) property and then click the ellipsis button that appears.
  6. In the Title Collection Editor that appears, set the following properties.

    Titles

    1. Under header properties, set the Text property to Candle Chart.
    2. Expand the Font property and set Font Size to 14.
    3. Under Members, select footer and click the Remove button.

  7. Click OK to return to the report design surface.
  8. With the Chart control selected, go to the Properties window and click the Legends (Collection) property and then click the ellipsis button that appears.
  9. In the Legend Collection Editor that appears, set the following properties.

    Legends

    1. In the Properties window, set the Visible property to False.
    2. Click OK to return to the report design surface and see the completed chart.

To view the report

OR

See Also

Concepts