Page 1 of 1

how to preserve chart zoom/scroll state and restore it

Posted: Thu Dec 04, 2008 5:48 pm
by 10050727
I am using Borland Delphi 2006 and TeeChart 8.1.

I would like to record the current zoom/scroll state of the chart and restore it later. I know how to get 3D state information, but not the 2D state information (i.e. View3DOptions. Elevation, Rotation, Zoom, HorizOffset, VertOffset).

For example, if the user scrolls by dragging the right mouse button or zooms by dragging the left mouse button, how do I obtain the resulting offset and zoom states? Are these axis attributes?

When I am ready to restore the chart to the saved state, what method do I use?

Thanks,
Kent

Posted: Fri Dec 05, 2008 9:42 am
by narcis
Hi Kent,

Zoom and scroll "states" can be defined by axes scales. Every time you perform one of those operations you should save axes min. and max. values to an array in the OnZoom and OnScroll events and retrieve array values when restoring "states". For setting again array values use axis SetMinMax method.

Hope this helps!