Fastline DrawAllPoints Clarification

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
noaksey
Newbie
Newbie
Posts: 55
Joined: Wed May 23, 2007 12:00 am

Fastline DrawAllPoints Clarification

Post by noaksey » Tue Aug 25, 2009 4:25 pm

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

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

Re: Fastline DrawAllPoints Clarification

Post by Narcís » Wed Aug 26, 2009 11:49 am

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.
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

noaksey
Newbie
Newbie
Posts: 55
Joined: Wed May 23, 2007 12:00 am

Re: Fastline DrawAllPoints Clarification

Post by noaksey » Wed Aug 26, 2009 12:59 pm

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

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

Re: Fastline DrawAllPoints Clarification

Post by Narcís » Wed Aug 26, 2009 2:26 pm

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!
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

noaksey
Newbie
Newbie
Posts: 55
Joined: Wed May 23, 2007 12:00 am

Re: Fastline DrawAllPoints Clarification

Post by noaksey » Thu Aug 27, 2009 11:05 am

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 15031 times

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

Re: Fastline DrawAllPoints Clarification

Post by Narcís » Thu Aug 27, 2009 11:35 am

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.
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

noaksey
Newbie
Newbie
Posts: 55
Joined: Wed May 23, 2007 12:00 am

Re: Fastline DrawAllPoints Clarification

Post by noaksey » Thu Aug 27, 2009 11:43 am

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

noaksey
Newbie
Newbie
Posts: 55
Joined: Wed May 23, 2007 12:00 am

Re: Fastline DrawAllPoints Clarification

Post by noaksey » Wed Sep 02, 2009 9:31 am

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
Attachments
FastlineTest.zip
(29.55 KiB) Downloaded 714 times

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Fastline DrawAllPoints Clarification

Post by Yeray » Wed Sep 02, 2009 2:06 pm

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();
        }
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

noaksey
Newbie
Newbie
Posts: 55
Joined: Wed May 23, 2007 12:00 am

Re: Fastline DrawAllPoints Clarification

Post by noaksey » Wed Sep 02, 2009 2:58 pm

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

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

Re: Fastline DrawAllPoints Clarification

Post by Narcís » Thu Sep 03, 2009 7:32 am

Hi noaksey,

Here I explained how DisplayedPointCount works.
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