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.... |
Home ChartPack RChart Class TRChart Events OnZoomPan | |||||||||
See also: TZoomPanEvent, ZoomHistory | |||||||||
OnZoomPan |
|||||||||
The event OnZoomPan occurs after the viewport of RChart has been zoomed or panned. See TZoomPanEvent for a detailed description of the event.
This event may be used to synchronize the viewports of several charts. Suppose you want to make sure that some chart "RChart2" always follows the range of the displayed area of another chart "RChart1". This can be easily achieved by setting the range of chart 2 when the OnZoomPan event is triggered:
procedure TForm1.RChart1ZoomPan(Sender: TObject); begin RChart2.SetRange (RChart1.Scale1X.RangeLow, RChart1.Scale1Y.RangeLow, RChart1.Scale1X.RangeHigh, RChart1.Scale1Y.RangeHigh); end; Note: You should always use the method SetRange (instead of the properties RangeLow and RangeHigh) for setting the displayed range of the chart, since setting the scale boundaries one after another would trigger automatic redraws and thus would slow down the display.
|