Tee chart Series Visibility and downsampling questions

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
gs
Newbie
Newbie
Posts: 84
Joined: Mon Mar 20, 2006 12:00 am
Location: US

Tee chart Series Visibility and downsampling questions

Post by gs » Wed Apr 15, 2009 5:40 pm

There are few things i will like to ask
1) I have a Teechart where in I draw Line chart. The user can configure the lines to be displayed using contextmenu selection. I made line visible or invisble by setting series.visible to true or false. This works fine.
There is a Grid in our application on change of selection of row i will clear the series & add new data to the series . The problem here is the scale of the chart does not change when new data is displayed . This problem wont happen when I use legend checkboxe to show & hide the lines instead of my contextmenu. Please let me know what really happens when we select unselect legend checkbox which is different then my doing it by setting series visible.
2) Axis label when its a big no say more than 5 digit number I am not able to see the complete number i just see 4 digits also the axis title is not displayed.
3) I was trying to use downsampling I add the data to a temporary series & then set it to the line by setting its datasource. I notice that the series is not displayed due to this.

Thanks

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Post by Sandra » Thu Apr 16, 2009 8:29 am

Hello gs,

1) I have a Teechart where in I draw Line chart. The user can configure the lines to be displayed using contextmenu selection. I made line visible or invisble by setting series.visible to true or false. This works fine.
There is a Grid in our application on change of selection of row i will clear the series & add new data to the series . The problem here is the scale of the chart does not change when new data is displayed . This problem wont happen when I use legend checkboxe to show & hide the lines instead of my contextmenu. Please let me know what really happens when we select unselect legend checkbox which is different then my doing it by setting series visible.
2) Axis label when its a big no say more than 5 digit number I am not able to see the complete number i just see 4 digits also the axis title is not displayed.
For this two questions please, could you send us a simple example project we can run "as-is" to reproduce the problem here? You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at ourupload page.
3) I was trying to use downsampling I add the data to a temporary series & then set it to the line by setting its datasource. I notice that the series is not displayed due to this.
I recomend use next code for example:

Code: Select all

line1.CheckDataSource();
Please, check that this code works fine in your application.

Thanks,
Best Regards,
Sandra Pazos / 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

gs
Newbie
Newbie
Posts: 84
Joined: Mon Mar 20, 2006 12:00 am
Location: US

Post by gs » Mon Apr 20, 2009 10:53 pm

Our app uses real time data and when I do a checkdatasource after adding all points in the parent series, i see the number of points in the series getting reduced but i see the series containing zeroth element as the average of all values rest all values are zero. This is not what i expected

I was thinking that if there are 50 points in the series & i say tolerance of 10 , the 10 points should be reduced by a 1 or 2 point with average of 10 points & there should be 5 points in the series but i dont see that

Also can you tell me what the function calculate in downsampling does & how it works.

Thanks

gs
Newbie
Newbie
Posts: 84
Joined: Mon Mar 20, 2006 12:00 am
Location: US

Tee chart Series Visibility and downsampling questions

Post by gs » Mon Apr 20, 2009 11:00 pm

In our app data is added realtime to the series. After adding data when I do checkdatasource i see the changed series has 0th elemnt as the average of all elements in the series & rest all elements are zeroes which i did not expected. I have set downsampling function as average.

I thought that if I have series with 50 points & set downsampling tolerance to 10. each set of 10 points will be replaced by average of those 10 elements & the new series will have 5 points. But i dont see this behavior. Can you pls explain whats the problem.

Also can you tell me what does the downsampling method calculate do.

Thanks,
Sachin

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

Post by Narcís » Tue Apr 21, 2009 9:13 am

Hi Sachin,

Could you please arrange a simple example project we can run "as-is" to reproduce the problem here?

You can create a dataset at runtime as Christoper Ireland's example here.

Files can be either posted at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

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

gs
Newbie
Newbie
Posts: 84
Joined: Mon Mar 20, 2006 12:00 am
Location: US

downsampling issue

Post by gs » Tue Apr 21, 2009 8:40 pm

I have uploaded the example in desktop.zip. I have modified existing downsampling sample

private void btnAddPoints_Click(object sender, EventArgs e)
{
int count = int.Parse(txtDataPoints.Text);
points1.Clear();
points1.BeginUpdate();
System.Random r = new System.Random();
double tmp = r.NextDouble() * 10000;
DateTime d = new DateTime();
for (int t = 0; t < count; t++)
{
tmp += r.Next(100) - 49.5;
d = DateTime.Now;
d = d.AddMinutes(t);
points1.Add(d , tmp);
}
points1.EndUpdate();
downsampling1.Recalculate();
label1.Text = "Data points : " + points1.Count;
label4.Text = "Reduced data size :" + line1.Count;
}

on button click event I am adding the data to the series. instead of using int value for x axis I am using datetime. After running this code i see downsampling doesnt work properly the reduction of datapoints is less than the tolerance factor. Also just the zeroth point is having valid value rest all are zeroes.

Thanks,
Sachin

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

Post by Narcís » Wed Apr 22, 2009 11:34 am

Hi Sachin,

You need to combine Tolerance with DisplayedPointCount here, for example:

Code: Select all

    private void btnAddPoints_Click(object sender, EventArgs e)
    {
        int count = int.Parse(txtDataPoints.Text);
				points1.XValues.DateTime = true;
        points1.Clear();
        points1.BeginUpdate();
        System.Random r = new System.Random();
        double tmp = r.NextDouble() * 10000;
        DateTime d = new DateTime();
        for (int t = 0; t < count; t++)
        {
            tmp += r.Next(100) - 49.5;
            d = DateTime.Now;
            d = d.AddMinutes(t);
            points1.Add(d , tmp);
        }
        points1.EndUpdate();
				downsampling1.DisplayedPointCount = Convert.ToInt32(downsampling1.Tolerance * 4);
				downsampling1.Recalculate();
        label1.Text = "Data points : " + points1.Count;
        label4.Text = "Reduced data size :" + line1.Count;   
    }
The DisplayedPointCount specifies how many points the DownSampling function should paint and displays this number as a maximum number of points.

Note that the DisplayedPointCount has to be multiplied by 4 when the Method is set to DownSamplingMethod.Average. This is because the number of points in the group of points used to calculate the function varies according to the different Methods set.
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

gs
Newbie
Newbie
Posts: 84
Joined: Mon Mar 20, 2006 12:00 am
Location: US

downsampling issue

Post by gs » Wed Apr 22, 2009 7:01 pm

I dont see DisplayedPointCount in v2 . Is it available in new version. I there any other alternative way to do this

Thanks,
Sachin

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

Post by Narcís » Thu Apr 23, 2009 7:27 am

Hi Sachin,

DisplayedPointCount is a new property in v3. In v3 DownSampling function was enhanced and I'm afraid it may not work with DateTime values in v3.
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

gs
Newbie
Newbie
Posts: 84
Joined: Mon Mar 20, 2006 12:00 am
Location: US

downsampling issue

Post by gs » Fri Apr 24, 2009 3:22 pm

when the datetime issue planned to fix?

Thanks,
Sachin

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

Post by Narcís » Fri Apr 24, 2009 3:24 pm

Hi Sachin,
I'm afraid it may not work with DateTime values in v3.
Sorry, my fault. I meant it may not work in v2 but already works fine in v3.
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