Page 1 of 1

Undo Scroll ?

Posted: Thu May 28, 2009 8:45 am
by 10052955
Hi there,

I have a TChart, which the user can scroll and zoom using the left and right mouse buttons.

Now I look for a way to undo zoom and scroll actions, i.e. to reset the chart.
UndoZoom does exist, but how can I do the same for the scrolling?

Thanks for the help!

Posted: Thu May 28, 2009 9:25 am
by yeray
Hi Windwalker,

Are you zooming and/or scrolling your chart manually? Or are you using the default zoom and scroll features?

By default, you can zoom the chart with left mouse button, drawing a rectangle (dragging left mouse button to the bottom right) in the zone you would like to zoom in.

By default, you can scroll your chart dragging the chart with right mouse button.

And also by default, you can undo both zoom and scroll actions drawing a "inverse" rectangle (dragging left mouse button to the top left).

If you changed your axes at runtime, you could restore the default view forcing them to be automatic:

Code: Select all

  Chart1.Axes.Bottom.Automatic := true;
  Chart1.Axes.Left.Automatic := true;

Posted: Thu May 28, 2009 9:34 am
by 10052955
9348257 wrote:Hi Windwalker,

If you changed your axes at runtime, you could restore the default view forcing them to be automatic:

Code: Select all

  Chart1.Axes.Bottom.Automatic := true;
  Chart1.Axes.Left.Automatic := true;
Thanks, that's it!