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

3.12 User Interaction and Feedback

Much of the functionality provided by the Objective Chart view classes — data selection, zooming, data dragging, and chart tips — is made possible by the feedback management system. Objective Chart stores information relating each line, wiget, bar, or pie wedge on the screen to the data object that it represents. This makes it possible to quickly determine which data object is displayed at the location of the mouse pointer or any other screen location.

The following topics describe the operation of user interaction and feedback:

3.12.1 Feedback Management

Many data items drawn on the charts are constructed from polygonal shapes. By storing a record of the polygon with a reference to the data object that created it, a direct link between objects on the screen and the data array is possible. For example, when the mouse pointer is over a wiget, it is easy to determine which data object is associated with the particular wiget. This technique allows Objective Chart to perform data dragging and chart tip feedback. Figure 15 shows a chart tip generated by the feedback system.

Figure 15: A chart tip generated by the feedback system

3.12.2 SRGraphFeedback

The polygon and data reference information for each graphic object are stored in an SRGraphFeedback object. Objective Chart maintains a list of these objects in SRGraph's m_FeedbackList member, which is a CObList. Feedback may be checked for a point on the screen by interrogating this feedback list. The point is normally derived from the mouse cursor position, but it is possible to request feedback information for any point. The feedback list is searched for the feedback object containing a polygonal region that contains the point in question. If a hit is found, the associated item in the data array can be accessed for relevant information.

Figure 16 shows the arrangement of data held in a feedback object.

Figure 16: The SRGraphFeedback object and its data

If the data item is not represented by a polygon (e.g. LineOnly chart) or a single polygon represents many data values (e.g. Area chart), a point on screen can be used as a feedback area. A margin of 5 pixels is placed around the point so that the point is easier to locate or hit with the mouse.

The chart display system depends on the painter's algorithm for its z ordering. Therefore, the feedback objects are searched in order and only the one furthest down in the feedback list is returned. This guarantees that feedback is taken from a visible graphic object — not from one which covered that point earlier in the draw cycle.

It is possible to have more than one feedback object associated with the same data item. For example, the top, side, and front facets of 3D bars each have a feedback object.

3.12.3 SRGraphPosition

The feedback list is a ready source of information when the cursor is on a data item. However, when selecting an area for zooming or while dragging a data item, the cursor is not necessarily over a data item. In these situations, the view classes use the SRGraphPosition class to gather data about the mouse cursor position.

The view class can obtain an SRGraphPosition object filled with information about the cursor position (Spoint) by simply calling

SRGraphPosition finds a display component in the component list. Then, depending on the chart type and axis scaling information, it makes estimates for all the values that it can about the cursor position.

The type and amount of information that can be estimated depends on the chart type. The data may include any or all of the following:



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.