SRGraph Class Overview

SRGraph is the main class within which all other Objective Chart functions and data storage tasks are wrapped.

Because of the connection between Objective Chart and Objective Grid data storage methods within Objective Chart have been designed to approximate the two dimensional array's used in grid and spreadsheet applications.

SRGraph holds several data arrays.

The first m_data is a CPtrList object which keeps a list of SRGraphDataList objects. This list can be thought of as the ROW edge cells in the spreadsheet. Each item on the list is the header for a complete row of cells. Columns and in particular the data cells are the SRGraphData objects held in the lists.

Begining with the version, this m_data member is moved into another class SRGDataManager. All the data management is put into the SRGDataManager class. However, it is still backward compatible. All you have to do is to create a SRGDataManager object and pass it to the SRGraph instance before you start put or get the data into the graph. The advantage of this separation is that several SRGraph instances can now share the SRGDataManager object. If application use the SRGraph object to setup the data, the data is in fact still stored into the including SRGDataManager object. So it is hight recommended that application use the SRGDataManager object to setup the data for the graph. When a SRGDataManager object is passed to the SRGraph object, application should indicating how the memory of the SRGDataManager object will be freed. During the serialization of SRGraph there is also a decision application has to make, i.e., whether the graph object should serialize the SRGDataManager object internally or the SRGDataManager object will be serialized outside the SRGraph object.

As well as storing data the SRGraph class also stores the visual appearance of the graph as a list of SRGraphComponent based objects in the m_ComponentList member. An interesting feature of SRGraph and the Objective Chart system in general is that it does not have a dedicated CWnd based class in which to display the chart data. A simple window used in the application is used as a drawing surface thereby allowing graph and chart displays to be drawn anywhere. In dialogs, on buttons even in a grid-cell itself.

The SRGraph class also provides a specialised feedback system through the m_FeedbackList member. As objects are drawn on the graph. For example a pie wedge in a pie chart, the area covered by that wedge may be optionally logged by SRGraph. Once the drawing process has finished a complete list of areas covered by data representations is available. This list can then be interrogated by using the screen coordinates, perhaps a data cursor or the mouse, and information about the data retrieved in the form of an SRGraphFeedback object.