SRGraphDisplay Class Overview

Based upon SRGraphComponent this class is responsible for drawing the graph itself. It uses the data stored in its parent SRGraph object to draw labels, axes and data. It inherits from its base class the ability to fill its background, draw a border and cast a shadow.

Each component may use the whole of the data array or select a rectangular portion from which to draw its values. This, in the case of SRGraphDisplay, allows many display panels to share data from a single gridded array of data. This makes the construction of multi display or multi axis graphs possible. SRGraphDisplay uses a system of dynamic scaling to find the best fit for all information in the graph. Draw cycles are begun with the display having access to the entire surface of the component upon which it is based. As the labels, axis and data are drawn the items are sized and placed, very often in a two pass process to allow the final graph to be shown without having labels overprinting one another or data items overflowing the graph axis area. The diminution of the usable area is tracked in the m_DisplayRect member of the SRGraphDisplay object. The size of this rectangle after the draw has taken place is the final size of the data area. This is in fact used by the SRGraphPosition class to detect values and positions when feedback is required from the graph itself As with most of the automatic functions in the Objective Char package the automatic sizing may be turned off. using the rectangle locking function. In this case you are responsible for ensuring that adequate room is given to the labels or other items otherwise the graphics may be clipped by the component rectangle itself. This feature is provided to allow the absolute positioning of multiple components. For example you may require two or more display objects to be displayed one above the other. Under normal circumstances the edges of the display will move to accommodate longer or shorter labels and may indeed be re-sized away to nothing if the labels are long enough. By locking the display rectangles into position you can define the exact boundaries and hence the exact alignment of all of the items being displayed thereby ensuring that a particular series is shown in exact proportion to the one above or below it.