I can't get a correct average line
Posted: 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
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