Zoom should manipulate "Page" and "MaxPoints

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
klaus
Newbie
Newbie
Posts: 4
Joined: Tue May 11, 2004 4:00 am

Zoom should manipulate "Page" and "MaxPoints

Post by klaus » Fri Dec 22, 2006 12:54 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Dec 22, 2006 1:01 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

klaus
Newbie
Newbie
Posts: 4
Joined: Tue May 11, 2004 4:00 am

Post by klaus » Fri Dec 22, 2006 1:51 pm

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

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Sat Dec 23, 2006 10:58 am

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.
Marjan Slatinek,
http://www.steema.com

Post Reply