Hello,
I have 2 candlestick series with Teechart. One is the candlestick from 1 year ago going to today. The second is the future price projection.
Right now, when the chart is loaded, it comes the beginning of the historical year i.e far left. How do I move the scroll position so current date is shown in the middle of the screen.?
-Mike
Scroll location
Re: Scroll location
Hi Mike,
Use the bottom axis SetMinMax function. Pass the "start" and "end" TDateTime you wish to the SetMinMax function.
Use the bottom axis SetMinMax function. Pass the "start" and "end" TDateTime you wish to the SetMinMax function.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Scroll location
Hello Mike,
An example that allows you achieve the suggestion of Yeray, is using similar code as next:
I hope will helps.
Thanks,
An example that allows you achieve the suggestion of Yeray, is using similar code as next:
Code: Select all
Uses Series;
procedure TForm1.FormCreate(Sender: TObject);
var Series1:TLineSeries;
dif:double;
t:Integer;
today: TDateTime;
begin
today:= Now;
Series1 := TLineSeries.Create(self);
Chart1.AddSeries(Series1);
Chart1.View3D:=false;
//previous
Series1.AddXY(EncodeDate(2011, 4, 10), Random(10));
Series1.XValues.DateTime:=true;
for t := 1 To 25 do
Series1.AddXY(EncodeDate(2013, 4, t), Random(t));
//Future
Series1.AddXY(EncodeDate(2013, 6, 10), Random(10));
Chart1.Axes.Bottom.LabelsAngle:= 90;
Chart1.Axes.Bottom.SetMinMax(today-5, today+5);
Chart1.Axes.Bottom.Increment := DateTimeStep[dtOneDay];
Chart1.Axes.Bottom.MinimumOffset :=40;
Chart1.Axes.Bottom.MaximumOffset := -20;
Thanks,
Best Regards,
Sandra Pazos / 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 |