Coordinate Conversion between Layers

Problem I am using several layers of RChart and I want to convert between the coordinate systems of two layers. What do I have to do if I want to know the coordinates in layer B of a particular point which belongs to layer A?
Applies To SDL Suite (ChartPack) Release 8.0, or higher
Solution There are two functions (R2M and M2R) which relate the layer coordinate system to the screen coordinate system and vice versa. These two functions can be used to convert between the coordinate systems of different layers. The following example shows how to convert between the coordinate systems of layer 2 and layer 3:

const
  LAYER_A = 2;
  LAYER_B = 3;

var
  aux_x, aux_y : integer;
  lax, lay : double;
  lbx, lby : double;

....
RChart1.R2M (LAYER_A, lax, lay, aux_x, aux_y);
RChart1.M2R (LAYER_B, aux_x, aux_y, lbx, lby);
....

 


Last Update: 2006-11-21