Trend lines - 2 question

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Shimon
Newbie
Newbie
Posts: 22
Joined: Tue Nov 04, 2008 12:00 am

Trend lines - 2 question

Post by Shimon » Wed Mar 04, 2009 10:37 am

Hello,

I have uploaded 2 images (upload page) to make things clear - ShimonSoferTrendQ1.png, ShimonSoferTrendQ2.png .

My questions

1. In the first image (not all points are displayed) I see the the slope makes sense but the height of the line has certain offset... I also noticed that this y-offset is changing significantly when new points are inserted to the series...

The code I am using is -

MA := TTrendFunction.Create(Self);
MA.Period := 0;

With Self do // Self is the Tee Chart itself...
begin
tmpHighLine:=TLineSeries.Create(self);

tmpHighLine.XValues.DateTime:=True;
tmpHighLine.Color := clRed;
tmpHighLine.VertAxis := aRightAxis;

AddSeries(tmpHighLine);
//Define the Function Type for the new Series
tmpHighLine.SetFunction(MA);

tmpHighLine.DataSource := FLineSeries
end;


2. In the second image you can see that I am using a Period which is different from 0 (actually 20). Again you can see the y-offset of the line from the points but another issue bother me : The many trend lines are connected to each other... I would like the lines to be separated...

Thanks,
Shimon

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Thu Mar 05, 2009 9:48 am

Hi Shimon,

1. You say that you are not displaying all the points, so you are controlling your bottom axis manually, aren't you? If you aren't controlling also manually the left axis and you want to do it, consider using the function commented here

2. To draw a uncontinuous line, you could add some null points. IO think you could do something similar to the demo at What's New?/Welcome/New in Series/FastLine TreatNulls
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Shimon
Newbie
Newbie
Posts: 22
Joined: Tue Nov 04, 2008 12:00 am

Post by Shimon » Thu Mar 05, 2009 9:54 am

Thank you for your answers.

1. I am displaying all points - the screen shot I have sent you doesn't contain all the region - that what I meant.

So I still dont have solution for the height offset. Even when I checked the calculation without the display (by looking at the points coordinates in a log file) I saw the the "y" offset of the line I talked about.

2. Thanks about the null values - I'll check that.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Thu Mar 05, 2009 3:42 pm

Hi Shimon,

I'm not sure to understand what is your exact problem. Please, could you send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply