Page 1 of 1

Trend lines - 2 question

Posted: Wed Mar 04, 2009 10:37 am
by 10550741
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

Posted: Thu Mar 05, 2009 9:48 am
by yeray
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

Posted: Thu Mar 05, 2009 9:54 am
by 10550741
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.

Posted: Thu Mar 05, 2009 3:42 pm
by yeray
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.