I can't get a correct average line

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Wicket
Newbie
Newbie
Posts: 20
Joined: Mon Jan 15, 2007 12:00 am

I can't get a correct average line

Post by Wicket » Tue Mar 27, 2007 6:36 am

I'm struggeling with an average line that isn't showing correctly. I have some lines on my chart with different number of points. Each point has a DateTime x-value and a float y-value. The problem occurs when the lines do not 'start' at the same DateTime (x-value). In thoose cases, the average value is calculated incorrect, it seems like each 'first point' are included in the average lines first point, no matter what DateTime value the 'first point' for each line has.

So... I read somewhere that 'null' points could be added to my lines in order to make them include the same number of points. I tried to do "myLine.Add()" each time a point was 'missing', but the result wasn't exactly what I expected. If the first point that is added for a line is a null point, the graph (including the average value) starts at 1800-something. Even if I make sure each line has a valid first point, the average isn't calculated correctly anyway.

I looked for a way to add a point like myLine.Add(myDate, null), but it seems unsupported.

Is there a solution to my problem?

Regards Andreas

Wicket
Newbie
Newbie
Posts: 20
Joined: Mon Jan 15, 2007 12:00 am

Post by Wicket » Tue Mar 27, 2007 2:27 pm

Is my question unclear or stupid?

I really can't get the average line to work correctly. Can anyone just give me a little hint or a follow up question?

Best Regards Andreas

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Mar 27, 2007 2:36 pm

Hi Andreas,

Your question not unclear neither stupid. We just need to review Average function behaviour. We will get back to you when we have further information.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Wicket
Newbie
Newbie
Posts: 20
Joined: Mon Jan 15, 2007 12:00 am

Post by Wicket » Wed Mar 28, 2007 10:36 am

Ahh, great to hear Narcis!
I look forward to your answer!

%Regards Andreas

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Mar 30, 2007 2:19 pm

Hi Andreas,

The only solution is to use the very same x values in all series to obtain the appropriate average. A solution could be adding null values for the points that shouldn't be in the series but it is not supported in current version. It is already on our wish-list to be implemented 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
Image Image Image Image Image Image
Instructions - How to post in this forum

Wicket
Newbie
Newbie
Posts: 20
Joined: Mon Jan 15, 2007 12:00 am

Post by Wicket » Mon Apr 02, 2007 7:58 am

Hi again, and thatn you for your reply!

The solution with adding the exact same x-values for each line has a problem (as I guess you know). I'll need to add points for lines where I have no valid Y-value, and since null isn't allowed I'll need to go with 0 (or something) and make the point transparent. The problem is just that the '0' will affect the calculated average line.

Perhaps I should create my own average function... At least until null values are supported.

Regards Andreas

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Apr 02, 2007 9:29 am

Hi Andreas,

Yes, that may be an option. To create your custom function you can use Custom y=y(x) function as shown at All Features\Welcome !\Functions\Extended\Custom y=y(x) example in the features demo.

You'll find the demo at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply