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

3.8 Annotation Classes

Annotations are an important part of the chart or graph. Objective Chart has a flexible annotation system that allows you to associate many separate text strings with one item. These annotation lists are primarily used to provide multilingual labels for the chart.

Annotations can now comprise multiple line text. Use the new line character \n to separate lines.

3.8.1 SRGraphAnnotation

A numeric (country) code is tied to each text string in an SRGraphAnnotation object.

3.8.2 SRGraphAnnotationList

SRGraphAnnotation objects are rarely used alone. They are generally stored in an SRGraphAnnotationList, derived from CObList. At any time, the annotations with a particular code value are displayed. The displayed annotation set can be selected instantly by changing the country code key stored in the main graph object.

For example, you can store strings in various languages for all the countries in which your company does business. Each string can be coded with the country's telephone dialing code. When the application containing this chart is distributed to the various countries, the chart automatically (given the proper setup) displays its labels in the appropriate language.

A member variable in the SRGraph object determines which set of annotations is displayed. By default, it is set to 01, the country code of the USA, but other codes could be used. For example, one set of annotations could be displayed for company executives and another for the shareholders.

The figure below shows the structure of an SRGraphAnnotation and SRGraphAnnotationList.

Figure 13: Block diagram of an annotation

All of the data storage objects in Objective Chart have an annotation list associated with them. The annotation list of the data lists are used as group headers, which are often displayed in legends and occasionally as axis labels. The annotation lists of the individual data items are often used as axis labels and included in chart tips. For a few chart types, they may appear in legends. The SRGraph object has an annotation list that is displayed in an SRGraphTitle component as a title for the chart. The text in an SRGraphLabel object is stored as an annotation list.

The power of this annotation system may not be required for most applications. An annotation list with one annotation string does take up slightly more space than, say, a CString. Overall, the overhead is minimal. If labels are not needed for a particular object, they do not need to be provided.



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.