Zooming boundaries...
Zooming boundaries...
Hello Steema-Experts...
How can I set boundaries for zooming so that it doesn't look like this:
This picture was taken while I zoomed by mouse...
I want to beware that the user can draw the red-colored zooming area over the left-axis...
How can I set boundaries for zooming so that it doesn't look like this:
This picture was taken while I zoomed by mouse...
I want to beware that the user can draw the red-colored zooming area over the left-axis...
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi bingo72,
Could you please send us a simple example project we can run "as-is" and let us know the steps we should follow to reproduce the problem here and also the TeeChart version you are using?
You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
Could you please send us a simple example project we can run "as-is" and let us know the steps we should follow to reproduce the problem here and also the TeeChart version you are using?
You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi bingo72,
I've sent you a forums private message with the e-mail address where you should send the project at.
Thanks in advance.
I've sent you a forums private message with the e-mail address where you should send the project at.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi.
I think in your case a simple solution would be to allow zoom only if mouse position is within a tChart.ChartRect rectangle. You could use tChart.OnMouseDown event to allow/disable zooming. Something like this:
I think in your case a simple solution would be to allow zoom only if mouse position is within a tChart.ChartRect rectangle. You could use tChart.OnMouseDown event to allow/disable zooming. Something like this:
Code: Select all
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Chart1.Zoom.Allow := PtInRect(Chart1.ChartRect,Point(X,Y));
end;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Hi.
Ok. How about manualy clipping zooming rectangle by using tChart OnMouseMove and OnAfterDraw events ? Something like this:
Ok. How about manualy clipping zooming rectangle by using tChart OnMouseMove and OnAfterDraw events ? Something like this:
Code: Select all
procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
Chart1.Canvas.UnClipRectangle;
end;
procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Chart1.Canvas.ClipRectangle(Chart1.ChartRect);
end;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Marjan,
Wish list : could both your suggested behaviors (do not allow user to begin a zoom if they are outside the chart's inner rect and do not allow the zoom box rectangle to be dragged outside the chart's inner rect) be made a settable property of a chart ? Something like RestrictZoomToInnerRect (true/false) ?
Thanks,
Steve
Wish list : could both your suggested behaviors (do not allow user to begin a zoom if they are outside the chart's inner rect and do not allow the zoom box rectangle to be dragged outside the chart's inner rect) be made a settable property of a chart ? Something like RestrictZoomToInnerRect (true/false) ?
Thanks,
Steve
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Steve,
Sure, I've added your request to the wish-list to be considered for inclusion in future releases.
Sure, I've added your request to the wish-list to be considered for inclusion in future releases.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hello Marjan...
many thanks....your second tip....it helps!! That is what I want!!
3 further questions:
+) Is there a possibility that after zooming the zoom-brush-color is still visible in the zoomed area??
+) I only can zoom from left to right direction. That means that my mouse-down-position have to be smaller than my mouse-up-position when I want to have a zooming effect.
When I want to zoom from right to left...the zoom has no effect...should mean that the chart will not zoomed. Is there a possibility to zoom also from right to left in my chart??
+)In cases where I have further values 'behind' the left or right axis (for e.g.: I have values from t:=0secs. to t:= 30secs. and my chart show only a part from t:= 10secs. to t:= 20secs.). When my zooming-brush-area reaches the left (10secs.) or right axis (20secs.) I want to see also the values which are lower 10secs. or higher 20 secs. depends on my zooming direction??!!
Best regards
Thomas
many thanks....your second tip....it helps!! That is what I want!!
3 further questions:
+) Is there a possibility that after zooming the zoom-brush-color is still visible in the zoomed area??
+) I only can zoom from left to right direction. That means that my mouse-down-position have to be smaller than my mouse-up-position when I want to have a zooming effect.
When I want to zoom from right to left...the zoom has no effect...should mean that the chart will not zoomed. Is there a possibility to zoom also from right to left in my chart??
+)In cases where I have further values 'behind' the left or right axis (for e.g.: I have values from t:=0secs. to t:= 30secs. and my chart show only a part from t:= 10secs. to t:= 20secs.). When my zooming-brush-area reaches the left (10secs.) or right axis (20secs.) I want to see also the values which are lower 10secs. or higher 20 secs. depends on my zooming direction??!!
Best regards
Thomas
Hi,
or simply use an TColorBand Tool to draw a rectangle under the Series, specifiying the min and max of each axis.
Chart1.Zoom.Direction:=tzdHorizontal;
you should be able to zoom horizontally without taking into account the pos of the mouse.
One way would be to fill the rect after the Chart has been zoomed as in the following code :+) Is there a possibility that after zooming the zoom-brush-color is still visible in the zoomed area??
Code: Select all
procedure TForm1.Chart1BeforeDrawAxes(Sender: TObject);
begin
if zoom then
with Chart1.Canvas do
begin
Brush.Color:=clgreen;
Brush.Style:=bsSolid;
FillRect(Chart1.ChartRect);
zoom := false;
end;
end;
procedure TForm1.Chart1Zoom(Sender: TObject);
begin
zoom:=true;
end;
Setting :+) I only can zoom from left to right direction. That means that my mouse-down-position have to be smaller than my mouse-up-position when I want to have a zooming effect.
When I want to zoom from right to left...the zoom has no effect...should mean that the chart will not zoomed. Is there a possibility to zoom also from right to left in my chart??
Chart1.Zoom.Direction:=tzdHorizontal;
you should be able to zoom horizontally without taking into account the pos of the mouse.
I'm not sure if I undestand what you want, bcos onze you have zoomed an area of the Chart, even the zoom ends to the maximum axis value (on mouse up), no other axis values will be seen (greater than the max axis value). But in any case, you can customize the axis scales in the OnZoom event, setting a new min and max (using SetMinMax method), change the increment, etc...+)In cases where I have further values 'behind' the left or right axis (for e.g.: I have values from t:=0secs. to t:= 30secs. and my chart show only a part from t:= 10secs. to t:= 20secs.). When my zooming-brush-area reaches the left (10secs.) or right axis (20secs.) I want to see also the values which are lower 10secs. or higher 20 secs. depends on my zooming direction??!!
Pep Jorge
http://support.steema.com
http://support.steema.com