Page 1 of 1

Panning graph programmatically

Posted: Fri Aug 29, 2008 7:19 pm
by 14048359
Hi,

Is there a way to scroll the whole graph programmatically (not scrolling only one axis)? I would like to have the same behavior than when we pan with the mouse, except that I would like to specify an x-offset and y-offset. (Chart.Scroll(3,3) would be a perfect situation)

I tried (for example) leftAxis.Scroll(offset, checklimits), but I need the other axis to follow the specified scroll...

I looked at the source code the DoMouseMove event from Chart.cs and I would like to have something that does exactly that. Is there some way to do this or I have to copy all of the code in the chart class?

thank you very much!

Posted: Mon Sep 01, 2008 8:11 am
by narcis
Hi Qwerty,

You could use TeeChart's mouse events for that, using their e.X and e.Y arguments for the mouse position can using axes SetMinMax method. Before doing the first panning you should calculate each axis range to perform SetMinMax accordingly.