Objective Chart : PART II Programmer’s Guide : Chapter 23 Data Tagging System : Persistence Models for Data Tags
Persistence Models for Data Tags
The tag system supports three persistence models that allow a choice of tagging strategies. Persistence relates to the lifetime and storage of the tag or label object. The on-screen appearance of the tags is basically the same in all three models.
The first persistence model is called the local (or automatic) model. This uses a single tag object for all data items in a particular chart. As each data item is drawn, the local tag object is initialized with text, repositioned, and redrawn. Each data item appears to have its own tag, but only one SRGraphLabel object is used for all tags.
The second model is called persistent. In this model, the tags are added to the component list of the parent chart. If these temporary labels need to be updated, then the chart deletes and recreates them. When the chart is serialized, these temporary labels become permanent additions to the component list. This tag model incurs a considerable run-time overhead.
The third persistence model is called the blocked model. Under this scheme, the tag labels are added to a special label block that is, in turn, added to the end of the component list. This label block has collision detection enabled, so the tags are automatically moved to avoid overlapping other tags in the block. This persistence model also incurs a considerable storage and run-time overhead.
Apart from the collision avoidance feature of the blocked model, the tags appear the same in all three models.
Be aware that the models produce different results certain conditions. If a chart is saved (serialized) and subsequently restored into an older Objective Chart application that does not support the new tagging styles, the tags would not appear in the restored chart when the local model is used. The tags would be displayed if the persistent or blocked models were used. However, the older application would not support the new polygonal attributes, so the labels would be framed by simple rectangles.