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
I can't get a correct average line
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
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
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
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |