Graphs with Classic Axes

The Classic axis types are used to plot data along the scaled vertical axis. The data from one or more groups are plotted as a series. The data are spaced uniformly across the x-axis by their indices.

CX_AXIS_CLASSIC displays a numeric y-axis to the left of the graph.

CX_AXIS_CLASSIC_RIGHT displays a numeric axis to the right.

CX_AXIS_DATE and CX_AXIS_DATE_R are used when the data values are dates or times (COleDateTime objects).

The data axis (Y) is defined by an SRGDecimalScale object, or SRGLogScale for logarithmic scaling, or SRGDateScale for date/time values. The axis is automatically scaled to fit the data values. The axis limits can be set to specific values by calling pD‑>GetStyle()-> SetUseMaxScale(TRUE) with pD->SetMinRangeY(min) and pD‑>SetMaxRangeY(max), where pD is a pointer to the display component object.

The horizontal axis (X) is defined by SRGIndexScale. The annotations from the data objects (indices) in group 0 are used to label the axis.

The appearance of the axes can be modified using functions in the display component’s style member (e.g. SetShowXTicks, SetShowXGrid, SetAlwaysShowZero). Indeed, the y-axis labels can be completely hidden by calling pD‑>GetStyle()‑>SetShowNumerals(FALSE) or the x-axis labels can be hidden by calling SetShowIndices(FALSE). A logarithmic data axis can be selected by calling pD‑>GetStyle()‑>SetLog(TRUE).

The following graph types use classic axes:

Line and Line Only graphs

Step and Step Line Only graphs

Area graphs

Strata graphs

Freestyle graphs

Stock graphs

Area Stock graphs

Candle graphs

Hi-Low–Open-Close graphs

Line Graphs

Figure 66 – CX_GRAPH_LINE

The Line graph draws a line connecting the data points of a group. The data points can be optionally covered by wigets or point objects.

The appearance of the data line and wigets are determined by the style member of the individual data items. See “Data Object Appearance” for details.

Classic Axis. One group per series.

Line Only Graphs

CX_GRAPH_LINEONLY

A Line Only graph is a Line graph with no wigets.

Classic Axis. One group per series.

Step Graphs

CX_GRAPH_STEP

The Step graph is similar to a Line graph except that horizontal and vertical line segments (forming a step) connect the data points of a group. The data points can be optionally covered by wigets or point objects.

The appearance of the data line and wigets are determined by the style object of the individual data items.

Classic Axis. One group per series.

Step Line Only Graphs

Figure 67 – CX_GRAPH_STEPLO

A Step–Line Only graph is a Step graph with no wigets.

Classic Axis. One group per series.

Area Graphs

Figure 68 – CX_GRAPH_AREA

An Area graph is similar to a Line graph except the area below the data line is filled. If more than one group of data are plotted, they are drawn in order of decreasing average value so that the groups with smaller values are not obscured by the groups with larger values.

The appearance of the data line and the filled area for each group is determined by the group’s style object.

Classic Axis. One group per series.

Strata Graphs

Figure 69 – CX_GRAPH_STRATA

A Strata graph is similar to an Area graph, but it shows the summed total of a particular index over all groups. The height of the combined area represents the total over all groups. Sub-areas show how much each group contributes to the total.

For example, a Strata chart could be used to show the market share of individual car manufacturers (groups) over several years (indices).

The appearance of the data line and the filled area for each group is determined by the group’s style object.

Classic Axis. One group per series.

Freestyle Graphs

Figure 70 – CX_GRAPH_FREESTYLE

A Freestyle graph is one in which the data items themselves are programmed with individual object styles. By setting up or even dynamically changing the style for each SRGraphData item, you can change the appearance of a graph. One series may have lines and wigets. Another series may have bar graphs, and a third series could have polygonal pictographs. See “Data Object Appearance” for details.

Classic Axis. One group per series.

Stock Graphs

Figure 71 – CX_GRAPH_STOCK

A Stock graph displays high, low, and current or close data. The high and low information is obtained from the CScale member of the individual data items (SRGraphData). These values are updated automatically as values are sequentially set in the data items. In a Stock chart, a small rectangle is drawn from the current (close) value to the high value. Another bar is drawn, in a different color, from the current value to the low value. The current value is also covered by a wiget.

The style member of the group (SRGraphDataList) determines the appearance of the bars. The wigets’ color and shape are determined automatically. For example, the snippet below demonstrates setting the colors of the bars for group g:

m_Graph.GetGroup(g)->GetStyle()-> SetInteriorStyle(CX_INTERIOR_COLOR);

m_Graph.GetGroup(g)->GetStyle()-> SetColor(CXCLR_TEAL,CXCLR_MAGENTA);

Classic Axis. One group per series, using CScale data.

Area Stock Graphs

Figure 72 – CX_GRAPH_AREASTOCK

The Area Stock graph displays the same information as the Stock graph by forming filled polygons or ribbons from the high-current and low-current values of the data items in the series. No wigets are drawn.

The style member of the group determines the ribbons’ appearance.

Classic Axis. One group per series, using CScale data.

Candle Graphs

Figure 73 – CX_GRAPH_CANDLE

A Candle graph displays high, low, open, and close data. A single series is held in four consecutive groups. Group zero is the high value; group one, the low; group two, the open; and group three, the close. The sequence repeats thereafter with group four being the high values of the second series.

A small rectangle covers the range between the open and close values. A vertical line connects the high and low values.

The appearance of the lines and bars is determined by the settings in the style member of the individual data items of the first group. If the interior and frame styles of a data item is set to NONE, the style of the first group is used (SRGraphDataList object).

Classic Axis. Four groups per series.

Shaded Candle Graph

Figure 74 – CX_GRAPH_SHADEDCANDLE

The Shaded Candle graph is a variation of the Candle graph in which the bars between the open and close values are shaded to indicate which is higher. The lighter color is toward the open value.

Classic Axis. Four groups per series.

Hi-Low-Open-Close Graphs

Figure 75 – CX_GRAPH_HILO_OPENCLOSE

The Hi-Low-Open-Close graph displays the same information as the Candle graph. A vertical line is drawn from the low value to the high value. The open value is indicated by a horizontal line segment to the left of the vertical Hi-Low line. A line to the right represents the close value.

Classic Axis. Four groups per series.