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

5.1 Introduction


The sample code used in this chapter is available from the Rogue Wave Web site, as explained in Section 3.6.1, "Location of Sample Code," in the Stingray Studio Getting Started Guide.

The Fast Start example in Chapter 4 shows how to create a new application with AppWizard and incorporate an Objective Chart as its main view. In this chapter, you will learn how to integrate Objective Chart into existing Microsoft Foundation Class library (MFC) applications.

You need not be familiar with MFC to read through this tutorial, but it will help if you understand the class library overview. Following the instructions in this tutorial, you can create a dialog to display a chart, integrate a chart window with another window, and use the ComDoc system to link two related documents.

This tutorial has three steps. Each step adds a chart to the Scribble sample program. Steps Two and Three build on the previous steps. However, the functionality introduced with each step is independent of the others, so you can study each step in isolation.

For a hands-on learning experience, copy the Scribble project to a new directory and modify the code following the instructions below. The sample is located at ..\Chart\tutorial\Steps\Step1, within the self-extracting archive file, Stingray Studio Additional Samples.exe, as explained in Section 3.6.1, "Location of Sample Code," in the Stingray Studio Getting Started Guide.

Alternatively, you can simply read along and compile the completed code supplied for each step.

In the text of this tutorial, new lines that you need to add to code segments are highlighted in bold text for easy identification.


The dialog boxes and other images shown in this tutorial were created using Microsoft Visual Studio 2005 SP1 under Windows Vista. If you use another version of Visual Studio or Windows, what you see on your screen will be different.

In Step One: Creating and Displaying the Statistics Chart, statistics about Scribble's strokes are displayed in a chart control in a dialog box. The basic Objective Chart classes SRGraph, SRGraphDisplay, SRGraphTitle, and SRGraphLegend are introduced.

Step Two: Plotting Scribble Data with an X-Y Scatter Chart displays an X-Y scatter chart in the second pane of Scribble's splitter window. This second view of Scribble's data is based on the SRGraphView class. The SRGraphData class is also used.

In Step Three: ComDocs and Document Linking, a secondary (or child) document and view are created to display another X-Y scatter chart. Objective Chart's specialized document class CGraphDoc is used in the second document template. CGraphDoc is based on SECComDoc and contains an SRGraph storage object. An SRGScrollView object provides a view for the graph. For demonstration purposes, the SRGraph data merely duplicates the stroke data contained in the original CScribbleDoc document. Using Objective Chart's ComDoc system, the two documents are linked. When the user changes data values in the chart (by dragging visual objects with the mouse), the corresponding points in the list of strokes change as well.



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.