Page 1 of 1

Strange behavior when DrawAllPoints property is set to FALSE

Posted: Fri Jan 30, 2009 9:35 am
by 13050339
Hi Steema,

When we set DrawAllPoints = False, we recognized that TeeChart will take some points from all points to build serie randomly.
For example: we have a set of data as following:
X Y
2009-01-22-11.55.41.250000 1
2009-01-22-11.55.48.390000 1
2009-01-22-11.56.17.343000 1
2009-01-22-11.56.17.437000 0
2009-01-22-11.56.17.531000 1
2009-01-22-11.56.17.640000 1
2009-01-22-11.57.49.968000 1

After 1s we refresh and rebuild serie again, we saw that:
1-st times:
2009-01-22-11.55.41.250000 1
2009-01-22-11.55.48.390000 1
2009-01-22-11.56.17.343000 1
2009-01-22-11.57.49.968000 1

2-nd times:
2009-01-22-11.55.41.250000 1
2009-01-22-11.55.48.390000 1
2009-01-22-11.56.17.437000 0
2009-01-22-11.57.49.968000 1

3-rd times:
2009-01-22-11.55.41.250000 1
2009-01-22-11.55.48.390000 1
2009-01-22-11.56.17.640000 1
2009-01-22-11.57.49.968000 1

and so on ...

It causes a displeasure affect that our real time chart is changed after refreshing the old part of data.
Please give us a advice in this situation.
Could you please give us a solution to avoid above situation or should we consider the above behavior as a bug and will be fixed in next release.

Thanks in advance.

Posted: Fri Jan 30, 2009 11:03 am
by yeray
Hi Haianh,

Here you have the explanation at the property help:
help wrote:property DrawAllPoints: Boolean;

Unit
Series

Description
The DrawAllPoints property controls how many points in a FastLine series will be displayed.

The main reason of this property is to accelerate displaying thousands of points in a FastLine series.

When True (the default), all points are displayed.

When set to False, it will only display points that have a different "X" position in screen pixels.

So, when the series has several points that share the same X pixel position, but with different Y position, it will only display the first point.

When set to True (the default), only points that have a different X or a different Y pixel position are displayed.

In some cases, setting DrawAllPoints can dramatically speed up displaying a FastLine series with lots lots of points.
But, as not all points are displayed, the final output might not be as accurated.

When a FastLine series points have similar Y values from a big range ( YValues.MaxValue very different than YValues.MinValue ), DrawAllPoints might help to display them faster while lossing very little accuracy.

As we understand, this is working as expected because having more points, the distribution of your series per pixel will be a bit different.

On the other hand, you could consider using the function "DownSampling". You'll find a demo at "All features/Functions/Extended/Reducing Number of Points".

Finally, if you still think that this is a bug, please, send us a simple example project we can run "as-is" to reproduce the problem here and we will be glad to take a look at it. You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Posted: Mon Feb 02, 2009 4:41 am
by 13050339
Hi Yeray,

I send you a simple example project so that you can reproduce the problem.
Please find in upload folder with name HaiAnh, email: lquocthanh@yahoo.com and file name is : TeeChartDrawAllPointsBug.zip
You can also get the binary of this project in file : AxChartDrawAllPointsBugBinry.zip

This is a simple example of our real time chart . After interval time = 500 ms, chart will be refresh and rebuild serie.
You should use Visual Studio 2005 and upper to open this project, it was written in VB.NET and use ActiveX TeeChart 7j.


If you have any problem with this, please let me know.

Best regards.

Posted: Mon Feb 02, 2009 2:23 pm
by narcis
Hi Haianh,

I don't think this is buggy behaviour. Every time your chart is refreshed you remove your series and add same 7 points to the series. The only thing that changes is the bottom axis scale, that's why series is being painted in a different way everytime the chart refreshes.

Posted: Tue Feb 10, 2009 10:09 am
by 13050339
Thanks Narcis for your reply.

Because our real time chart is added new data after refreshing, so we remove old series and rebuild series.
But as you can see in our example, for this case, old data is displayed in a different way by time. (It is a special case, in fact our real time chart display a larger number of points and the new points replace old points time by time).
We don't want to set DrawAllPoints = True because performance and chart specific reason.
Please give us any solution for this situation?

Thanks again and best regards.

Posted: Wed Feb 11, 2009 4:07 pm
by yeray
Hi Haianh,

We've investigated the issue and I'm afraid that this is a problem without an easy solution. The problem here is that we have X values with high precision and every time the chart is moved and repainted, teechart assigns a pixel to each point using a "round" function. So, moving the points, the round function returns different pixels for points that in the last repaint were on the same pixel.

We suppose that your Y values are more similar between them than in the example you sent. So, the only think I can suggest you right now would be to draw a chart even more zoomed to force the similar X values to be drawn in different pixels.