ActiveReports for .NET 3 Online Help Request technical support
Financial Chart
See Also
User Guide > Samples and Walkthroughs > Walkthroughs > Standard Edition Walkthroughs > Basic > Chart Walkthroughs > Financial Chart

Glossary Item Box

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 have finished this walkthrough, you will have a chart that looks similar to the following.

Creating a new Visual Studio project

To create a new Visual Studio project

  1. Open Visual Studio.
  2. From the File menu, select 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. From the Project menu, select Add New Item.
  3. Select ActiveReports 3.0 File and rename the file rptCandleChart.
  4. Click Open.

Adding a chart control to the report

To add a chart control to the report

  1. Resize the section in which you want to place the chart.
  2. Click the ChartControl icon in the ActiveReports toolbox and draw it onto the report.

Adding a series and data points to the chart

To add a series and data points to the chart

  1. With the chart control highlighted, click the Series (Collection) property in the Properties Window, then click the ellipsis button that appears to open the Series Collection Editor.
  2. Click Series1 to select it.
  3. Under Series Properties, change the Type property to Candle.
  4. Expand the Properties and set the BodyDownswingBackdrop property to (Default) so that you can expand it and change the color to Fuchsia.
  5. Set the BodyUpswingBackdrop property to (Default) so that you can expand it and change the color to DarkViolet.
  6. Set the BodyWidth property to 5 to make the opening to closing figure bar, the candle, wider than the wick.
  7. Set the WickLine property to (Default) for a black wick.
  8. Click the Points (Collection) property, then click the ellipsis button that appears. 
  9. Click Add to add a data point, and set its YValues property to 99; 37; 53; 88.

    Note: The first YValue 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.

  10. Click Add to add another data point, and set its YValues property to 115; 22; 101; 35.
  11. Click Add to add another data point, and set its YValues property to 87; 1; 7; 80.
  12. Click Add to add another data point, and set its YValues property to 63; 14; 57; 25.
  13. Click Add to add another data point, and set its YValues property to 130; 25; 25; 120.
  14. Click OK to return to the Series Collection Editor.
  15. Set the Legend property to (none).
  16. Remove Series2 and Series3.
  17. Click OK to return to the report design surface.

Setting the chart's properties

To set the chart's properties

  1. With the chart control highlighted, click the ChartAreas (Collection) property in the Properties Window, then click the ellipsis button that appears to open the ChartArea Collection Editor.
  2. In the defaultArea properties, click the Axes (Collection) property, then click the ellipsis button that appears to open the AxisBase Collection Editor.
  3. Click the AxisX member, and click the Labels (Collection) property, then click the ellipsis button that appears to open the Array Data Editor.  Type the following into the editor, each item on a separate line as shown:
    • Monday
    • Tuesday
    • Wednesday
    • Thursday
    • Friday
  4. Click the OK button to return to the AxisBase Collection Editor, and delete the text from the Title property. 
  5. Click the AxisY member, expand the MajorTick property and set the Step property to 10.
  6. Set the AxisY member's LabelsVisible property to True.
  7. Set the AxisY member's Title property to $,000 and click OK to return to the ChartArea Collection Editor.
  8. Click OK to return to the report design surface.
  9. With the chart control highlighted, click the Titles (Collection) property in the Properties Window, then click the ellipsis button that appears to open the Title Collection Editor.
  10. In the header properties, change the Text property to "Candle Chart."
  11. Expand the Font property and set the Size to 14.
  12. Remove the footer title, and click OK to return to the report design surface.
  13. With the Chart control highlighted, click the Legends (Collection) property to open the Legend Collection Editor.
  14. Set the Visible property to False, and click OK to return to the report design surface.

Viewing the report

To view the report

  1. Add the ActiveReports viewer control to a Windows Form.
  2. Add the code needed to set the viewer document equal to the report document. See Using the ActiveReports Windows Form Viewer for help.
You can quickly view your report at design time by clicking the Preview tab at the bottom of the designer.

See Also

©2009. All Rights Reserved.