Page 1 of 1

Zoom should manipulate "Page" and "MaxPoints

Posted: Fri Dec 22, 2006 12:54 pm
by 9232434
Hello,

If I make a "zoom" with the mouse in the chart
OR
"move" the chart to left or right with the mouse

I would expect that the
variables
Chart1.MaxPointsPerPage
Chart1.NumPages
Chart1.Pages.Current
would be automatic modified.

How can I solve this problem?
Reg Klaus

Posted: Fri Dec 22, 2006 1:01 pm
by narcis
Hi klaus,

Those properties are not intended to be used like that. Please run the features demo at TeeChart's program group, go to the "Search" tab and type "MaxPointsPerPage". You'll be shown a number of examples using those properties.

What are you exactly trying to achieve? If you give us some more information we may be able to suggest you an alternative way to achieve what you need.

Posted: Fri Dec 22, 2006 1:51 pm
by 9232434
I do want to make following:

I do run a chart and display the page x from y.
OK works

I also have setup the control ChartPageNavigator1 to jump between pages.
OK works

With the control ScrollBar1 I do modify in OnChange
procedure TFrmMain.ScrollBarZoomChange(Sender: TObject);
begin
Chart1.MaxPointsPerPage:= ScrollBarZoom.Position;
end;
OK Works

ON THE OTHER HAND I have enabled in the chart
ZOOM Allow and also the scroll of the chart by mouse.

Now I do have following problem.
I if zoom in the chart or scroll left right the chart, the
values "page" and "MaxPointsPerPage" will NOT FOLLOW.

So after a zoom the ChartPageNavigator AND ScrollBarZoomChange will not synchronise and work again.

The ZOOM in the chart is very important to do it with the mouse.
I also enable ColorLineToolHoriz1 to messure out distances in the chart.

Any solution would on that would be fine.

Reg Klaus

Posted: Sat Dec 23, 2006 10:58 am
by Marjan
Hi.

As Narcis said, page navigation will work only if scrolling/zooming is not used at the same time. After you zoom or scroll, page index and MaxPointsPerPage will be lost and page navigation won't be correct. I'd disable the paging (and associated controls) if zooming or scrolling is used and allow paging ONLY with unzoomed and not-scrolled chart.

An alternative solution for paging WITH zooming and scrolling would be to use axis SetMinMax method to perform "paging". Something like this

Code: Select all

tChart1.Axes.Bottom.SetMinMax(currentmin,currentmin+range);
// move to next "page"
tChart1.Axes.Bottom.SetMinMax(currentmin+range,currentmin+2.0*range);
where currentmin defines current minimum and range number or range of points you want to display. Using this approach you can control "page" via the currentmin and number of points per page via the range variable.