Page 1 of 1

Fastline DrawAllPoints Clarification

Posted: Tue Aug 25, 2009 4:25 pm
by 14045263
Hello,

I hope someone from Steema can clarify what the DrawAllPoints = false property does in the Fastline series. The help file installed with version 3.5 and 4.0 says,

"When false, it only draws the first point at any X pixel location"

However, on the real-time article it states that;

it "groups the points with the same x screen pixel coordinate and replace them with two points (group minimum and maximum values)."

Which is it?

Thanks

Re: Fastline DrawAllPoints Clarification

Posted: Wed Aug 26, 2009 11:49 am
by narcis
Hi noaksey,

It is the first one. The real-time charting article was written in TeeChart VCL and there may be little differences between .NET and VCL versions. We also plan implementing different plotting methods when DrawAllPoints = false.

Re: Fastline DrawAllPoints Clarification

Posted: Wed Aug 26, 2009 12:59 pm
by 14045263
That's not good. I was hoping it was the second.

The graph will not accurately represent the data. It will appear to the user that some data points are lost. Then as they zoom in the data will change, only to disappear again when they zoom out.

What's the time schedule for correcting this bug.

Thanks

Re: Fastline DrawAllPoints Clarification

Posted: Wed Aug 26, 2009 2:26 pm
by narcis
Hi noaksey,

I don't think it is a bug but a feature request. Such methods may be implemented in a mid-term in v2009. You can try using existing DrawAllPoints implementation. If this doesn't fit your needs you may also want to have a look at the DownSampling function. You'll find a DownSampling example here:

http://www.teechart.net/support/viewtop ... ing#p41935

Hope this helps!

Re: Fastline DrawAllPoints Clarification

Posted: Thu Aug 27, 2009 11:05 am
by 14045263
Hi Narcis,

Thanks for your reply.

Our data is collected in real time. 1 to 10 points per second for a total time of up to 1 hour.

I've attached an image to show you some typical data. Each series may have 2000 - 60000 data points.

If I use DrawAllPoints=false then some of those spikes on the green series will disappear as some of the spikes are only 3 or 4 data points wide. I can't down sample as this data is collected in real time with the graph updated with new data points every second. Also, the user will want to zoom in on the detail in the graph. Obviously, if I down sample, then the detail will be lost.

Another problem is that as the data is collected, spikes will appear and disappear depending upon which data point is used for drawing. This is very disconcerting for the user as their data will appear to change. Again, if the user rescales the graph window the data will appear to change.

If this is not clear, then I'll create an example in code for you.

The reason I still think it's a bug is that I feel that the graph should accurately represent the data at all times. The current implementation of DrawAllPoints=false clearly does not do this. However, if you change your drawing algorithm to the way it worked in the old TeeChart and plot the min and max values at each pixel then it will accurately represent the data.

Best regards
data.gif
data.gif (9.85 KiB) Viewed 15017 times

Re: Fastline DrawAllPoints Clarification

Posted: Thu Aug 27, 2009 11:35 am
by narcis
Hi noaksey,

Yes, please. Could you attach a simple example project we can run "as-is" to reproduce the problem here so that we can compare it with different TeeChart versions?

BTW: Please have a look at the All Features\Welcome !\Functions\Extended\Reducing number of points\DownSampling Additions example. You'll see that every time zoom is performed DownSampling is recalculated according to new axes scales and series' visible points.

Thanks in advance.

Re: Fastline DrawAllPoints Clarification

Posted: Thu Aug 27, 2009 11:43 am
by 14045263
OK, I'll take a look at that example.

Also, I'll create a simple project. I'll do it next week as I'm very busy at the moment.

Best regards

Re: Fastline DrawAllPoints Clarification

Posted: Wed Sep 02, 2009 9:31 am
by 14045263
Hi Narcis,

I've created a small example for you. It's created using VS2008 and TeeChart 4.0.2009.28593.

This example only has 1300 data points but it shows the problem well. Just resize the main form and you will see the graph change.

I'll now look at the Down Sampling example you suggested.

Thanks

Re: Fastline DrawAllPoints Clarification

Posted: Wed Sep 02, 2009 2:06 pm
by yeray
Hi noaksey,

I've seen your example and applying the DownSampling function as NarcĂ­s suggested above could be something like following:

Code: Select all

        public Form1()
        {
            InitializeComponent();

            this.InitialiseCharts(this.tChart1);
            this.InitialiseCharts(this.tChart2);
            
            this.AddData(tChart1, true);
            Steema.TeeChart.Styles.FastLine FastLine2 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
            Steema.TeeChart.Functions.DownSampling DownSampling = new Steema.TeeChart.Functions.DownSampling();
            FastLine2.Function = DownSampling;
            FastLine2.DataSource = tChart1[0];
            DownSampling.DisplayedPointCount = 200;
            DownSampling.Method = Steema.TeeChart.Functions.DownSamplingMethod.MinMaxFirstLast;
            tChart1[0].Active = false;
            tChart1[1].CheckDataSource();
            
            this.AddData(tChart2, true);

            tChart1.Zoomed += new EventHandler(tChart1_Zoomed);
            tChart1.UndoneZoom += new EventHandler(tChart1_UndoneZoom);
        }

        void tChart1_Zoomed(object sender, EventArgs e)
        {
            tChart1[1].CheckDataSource();
        }

        void tChart1_UndoneZoom(object sender, EventArgs e)
        {
            tChart1.Axes.Bottom.SetMinMax(0, tChart1[0].Count);
            tChart1[1].CheckDataSource();
        }

Re: Fastline DrawAllPoints Clarification

Posted: Wed Sep 02, 2009 2:58 pm
by 14045263
Thanks Yeray for that example.

It seems to work well. I'll do some further testing.

Can you explain how DisplayedPointCount works? There's no documentation at all on it in the help file.

Is it the number of data points the function down samples to?

So, in your example code and for my 1300 data points, it will down sample the 1300 points to 200 data points?

Or as it's using MinMaxFirstLast option will that be 400 points?

Perhaps the best method would be to set DisplayedPointCount to the number of pixels in the graph? That would give me the best resolution.

Many thanks

Re: Fastline DrawAllPoints Clarification

Posted: Thu Sep 03, 2009 7:32 am
by narcis
Hi noaksey,

Here I explained how DisplayedPointCount works.