Hi,
we still use TeeChart version 6.01.
with 2 CursorTool-Lines the user can define a time-period at the x-axis.
On clicking a button we like to zoom the x-axis (the y-axis should stay the same) in a manner that the period defined by the cursortool-lines stretches to the whole x-axis (zoom-in).
Because we have trouble to code this task, I hope you could help us on this.
Thank you very much for your help,
Josef Gschwendtner
TeeChart 6.01: zoom by code
Re: TeeChart 6.01: zoom by code
Hello Josef,
I've tried the following code and it seems to respond as expected.
Doesn't it do what you are looking for? Don't hesitate to let us know if you still have problems with it.
I've tried the following code and it seems to respond as expected.
Code: Select all
uses Series, TeeTools;
var Cursor1, Cursor2: TCursorTool;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Chart1.View3D:=false;
Chart1.Legend.Visible:=false;
Chart1.AddSeries(TFastLineSeries).FillSampleValues();
Cursor1:=Chart1.Tools.Add(TCursorTool) as TCursorTool;
Cursor2:=Chart1.Tools.Add(TCursorTool) as TCursorTool;
Cursor1.Style:=cssVertical;
Cursor2.Style:=cssVertical;
Chart1.Draw;
Cursor1.XValue:=10;
Cursor2.XValue:=15;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Chart1.Axes.Bottom.SetMinMax(Cursor1.XValue, Cursor2.XValue);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TeeChart 6.01: zoom by code
Hi Yeray,
thank you for your response. This was not the solution, but now I found out by myself
I forgot, that I just have to set the Minimum/Maximum-Property to get the desired behavior.
Chart.Axes.Bottom.Automatic := False;
Chart.Axes.Bottom.Minimum := Round(FCursorToolFrom.XValue);
Chart.Axes.Bottom.maximum := Round(FCursorToolTo.XValue);
Thank you,
Josef
thank you for your response. This was not the solution, but now I found out by myself
I forgot, that I just have to set the Minimum/Maximum-Property to get the desired behavior.
Chart.Axes.Bottom.Automatic := False;
Chart.Axes.Bottom.Minimum := Round(FCursorToolFrom.XValue);
Chart.Axes.Bottom.maximum := Round(FCursorToolTo.XValue);
Thank you,
Josef
Re: TeeChart 6.01: zoom by code
Hi Josef,
I'm glad to be helpful one way or the other.
I'm glad to be helpful one way or the other.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |