Version

Working with Candle Chart Data

This topic discusses useful information that will help you to ensure that your data is rendered properly in the candle chart.

Data Requirements

While the Chart control allows you to easily point the chart to your own custom data, it is important that you are supplying the appropriate amount and type of data that the chart requires. If the data does not meet the minimum requirements based on the type of chart that you are using, an error will be generated.

The following is a list of data requirements for candle charts:

  • The data set contains at least one DateTime column and five numeric columns.

  • The five numeric columns are named in order: "Open", "High", "Low", "Close", and "Volume". The columns must be in the order. For binding to custom business objects, you have to implement ICustomTypeDescriptor to return the properties in the correct order.

  • If you are binding the candle chart to a series object, see Requirements for Series Binding for information on the series binding requirements.

  • If you are using the candle chart in a composite chart, see Axis Requirements for Composite Charts for information on the axis requirements for the chart.

Note
Note

If the data available is in a format where each column represents one line, and each row contains points for each line, then you should swap the rows and columns. For information on how to do this, see Swap Rows and Columns.

Mapping Data to a Candle Chart

The chart data is rendered using the following rules:

  • Each row in the data represents a single "candle".

  • The value in the "Date" column will be used for the label on the x-axis (horizontal axis).

  • A rectangle will be drawn, using the y-axis to plot the "Open" and "Close" values as the top and bottom of the rectangle.

  • If the "Open" value is higher than the "Close" value, the NegativeRangeColor will be used to fill the rectangle. If the "Close" value is higher than the "Open" value, the PositiveRangeColor will be used to fill the rectangle.

  • A vertical line will be drawn, using the y-axis to plot the "High" and "Low" values as the top and bottom of the line. This line is called the "wick".

  • The content of the Volume column is rendered only if the VolumeVisible property is set to True. (By default, this property is set to False.) The Y2-axis is used to plot volume values. By default, the Y2-axis is not visible, but this can be changed using the UltraChart.Axis.Y2.Visible property.

  • When binding to a DataTable, you can use CandleSeries to specify explicitly which columns should be used for Open, Close, High, Low and Volume.

See below for an example data set, along with the rendered candle chart.

StockDate StockOpen StockHigh StockLow StockClose StockVolume

1/3/2006

82

83

81

82

11715100

12/27/2005

83

84

82

82

4405500

12/19/2005

83

84

82

83

5459640

12/12/2005

87

87

83

83

7861060

12/5/2005

88

90

86

87

5285560

11/28/2005

89

90

88

89

5153080

11/21/2005

88

89

87

89

4548275

11/14/2005

84

88

84

88

6143900

11/7/2005

83

85

82

85

4352520

10/31/2005

82

83

81

83

6230800

10/24/2005

83

84

80

81

5158680

10/17/2005

82

85

82

83

7857220

10/10/2005

81

84

81

82

7269860

10/3/2005

80

81

79

80

6184360

9/26/2005

78

81

77

80

6023340

9/19/2005

78

81

77

80

6023340

9/12/2005

81

82

80

80

5022080

9/6/2005

80

82

80

81

4670325

8/29/2005

80

82

79

79

5034300

8/22/2005

83

83

80

80

4442100

8/15/2005

80

83

81

83

4577160

8/8/2005

83

84

82

82

4513760

8/1/2005

83

84

83

83

4453140

7/25/2005

84

85

83

83

4876580

7/18/2005

82

85

82

84

9002840

7/11/2005

79

83

79

82

9132500

7/5/2005

74

80

74

79

9347200

Shows a Candle Chart that's based on the data listed in the table above.