Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Chart User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

3.2 Graph Classes

Objective Chart operations are all encapsulated in one class, SRGraph. An object of this class may be used as a member variable in another class, as a local variable in a particular function, or as a global variable. This object contains and controls the working parts of the Objective Chart system in a series of linked lists — a data list, a list for visual components, and a list that optionally contains data for user feedback.

A derived class, SRDynamicGraph, is a substitute for SRGraph that allows alternative data storage models to be used. The Dynamic data storage model stores the data values in simple arrays instead of the internal list of data objects. It is useful when large amounts of data are to be plotted and when the individual styles and annotations of the data objects are not needed. The Structure data storage model can access data values stored in external (to the graph object) memory buffers. The only requirement is that the data values to be plotted in a series be uniformly spaced in memory.

The illustration below shows the hierarchy for the Objective Chart graph classes. In the hierarchy diagrams in this manual, the standard MFC classes from which the Objective Chart classes are derived are shown in white boxes.

Figure 4: Basic graph class hierarchy

3.2.1 SRGraph

SRGraph holds and manages the data used in the Objective Chart system. This data is split into three sections and managed by three separate lists: the data list, the component list, and the feedback list.

SRGraph also holds a text string (actually an annotation list), m_ Title, that is displayed by the optional title component as the chart title.

Figure 5 shows the relationships of the various lists.

Figure 5: SRGraph block diagram

3.2.2 SRDynamicGraph

SRDynamicGraph is an alternative to SRGraph that supports a different data storage scheme. SRDynamicGraph is the data manager for Dynamic and Structure data.

Briefly, the Dynamic data storage model stores data in a contiguous block rather than in a list of discrete data objects. This arrangement reduces the storage space required and allows quick access to the data memory through pointers.

In the Structure data storage model, the chart accesses data in a pre-existing memory block, external to the Objective Chart classes. The basic requirement is that the data values to be plotted must be uniformly spaced within the memory block. Various basic data types are supported.

SRDynamicGraph overrides certain SRGraph data access functions to make it appear to the component system displaying the data that the values actually come from the discrete list. The drawing system accesses Standard, Dynamic, and Structure data in the same way.

Note that the description here specifically does not use the term "static data" when referring to the linked list storage. The lists are still easily changeable, just slower to access.


SRGraph handles all three data storage models via one of its constructors. SRDynamicGraph is no longer required and is deprecated, although it is still provided for backward compatibility only. Please refer to the "SRGraph Class Overview" section in Objective Chart's Class Reference, ocref.chm, for further details.

3.2.3 Data Managers

SRGraph and SRGDynamicGraph defer all data access functions to their associated data managers, SRGDataManager or SRGDynamicDataManager. This level of indirection makes it easier to override the data access functions without customizing SRGraph itself. Also, it is possible to share a data manager and the data that it maintains between two or more charts.

SRGDataManager supports all three data storage models. SRGDynamicDataManager is customized for the Dynamic and Structure data storage models only.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.