The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



UseDataOf


Unit:SDL_rchart
Class: TRChart
Declaration: property UseDataOf: TRChart;

There are many situations where several charts are required to share their data. For example, one wants to have two charts - one which provides an overview of the data, and one which displays zoomed details of the same data. This can be accomplished by telling one RChart that it should use the data of another RChart. A maximum of 4 "slave" charts can be assigned to a "master" chart by assigning the name of the intended master chart to the property UseDataOf. Thereafter any change in the data of the master chart will be reflected also in the slave chart. Each of such coupled charts can have its own independent set of properties (i.e. range of axes, etc) thus enabling the user to create different views on the same data.

In order to decouple a chart from its master chart, the property UseDataOf has to be reset to nil (which is the default value).

Please note, that in principle it does not make any difference whether any drawing operations are performed in the master chart or in one of the slave charts. The results will be reflected immediately in all charts which share the common data. However, for clarity of code, it is strongly recommended to use only the master chart for drawing operations.

When assigning a master chart, two kind of assignments are not allowed: (1) a chart cannot share its own data (assigning its own name to the property UseDataOf ). In this case the user is prompted by a message 'cannot share my own data'. (2) A chart which is already a master cannot be assigned as a slave to another chart. Again, the user is prompted by an error message, if she tries to do so.

Example: RCSHARED.DPR
  The sample program RCSHARED.DPR shows the power of the RChart data sharing concept. The program provides a survey plot and two detailed views of the same data using only about 20 statements. The detail windows can be zoomed and panned.

Example: This property is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): rcshared



Last Update: 2023-Dec-13