|Declaration:||property ActiveLayer: integer; |
The property ActiveLayer controls the currently active layer and may assume values between 1 and MAXNUMRCLAYERS. In general, drawing elements are always drawn on the currently active layer (without regard to the visibility of the active layer). In addition, the grid of a chart is always corresponding to the coordinate system of the active layer. Thus switching the active layer changes the grid.
The following properties, events and methods return information from the active layer or apply to the active layer: TickposX, TickPosY, TickNumX, TickNumY, OnMouseMoveInChart, MouseBox, MousePosX, MousePosY, FindNearestItemScreen.
||Changing the active layer triggers a repainting of the chart - which may reduce the performance of RChart to unacceptable levels, if the change of active layers is performed within loops. To cope with such situations, you should use the property SuppressPaint to prevent any redraws during drawing a chart.
Following is an example how to use SuppressPaint (please note, that changing SuppressPaint from false to true implicitely calls ShowGraf, so the usual ShowGraf at the end of the drawing routine is superfluos and would reduce the performance of RChart):
RChart1.SetRange(1, 0, -5.5, 120, 5.5);
for i := 1 to 200 do
RChart1.Line(i-1, OldY1, i, NewY);
RChart1.Line(i-1, OldY2, i, NewY);
||In order to affect all layers when interactive panning and zooming is enabled (property MouseAction = maPan, maZoom, ....) you have to configure the array property MouseAffectsLayer accordingly.
||In the Light Edition the number of layers is restricted to 2.