This is a migrated thread and some comments may be shown as answers.

SamplingUnit of NONE does not disable sampling

6 Answers 81 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Veteran
Brandon asked on 17 Mar 2021, 06:41 AM

I am trying to use Data Sampling with a DateTime-based data series.  In my main project, I want to dynamically adjust the sampling unit and interval based on the user's zoom level (e.g.turn off sampling when zoomed in to 1 minute, set sampling to 15 minutes when zoomed out to 1 day).

Explicitly setting my SamplingUnit and SamplingUnitInterval works for any value other than NONE.  My data is at 1-second intervals, so Second and NONE should be identical.  However, SamplingUnit of NONE samples my data at 4-second intervals.

I have a sample project to demonstrate this, but I don't see how to attach the zip file (I can only attach image files).

 

Thanks,

Brandon

6 Answers, 1 is accepted

Sort by
0
Brandon
Top achievements
Rank 1
Veteran
answered on 17 Mar 2021, 06:03 PM

I see my problem now.  This post (https://www.telerik.com/forums/bind-samplingthreshold) clued me in.

The default SamplingThreshold is 1000.  So when I set my SamplingUnit to NONE, it doesn't actually disable sampling, it just reverts to using the threshold value.  If I want to effectively have no sampling and see every data point, I need to set my SamplingThreshold to a value greater than the number of points in my data set.

0
Brandon
Top achievements
Rank 1
Veteran
answered on 17 Mar 2021, 09:40 PM
Actually, this does still seem to be a bit of an issue.  While SamplingUnit NONE with a large enough SamplingThreshold shows all my data points, it still is performing the aggregate functions even though each point is its own group.  It seems like performance would be better if there was a way to skip the aggregation entirely when I'm zoomed in enough to see my individual data points.  Is there a way to do this?
0
Accepted
Dilyan Traykov
Telerik team
answered on 19 Mar 2021, 07:46 PM

Hello Brandon,

Thank you for the detailed description of your scenario.

Indeed, such an optimization sounds logical and I will forward it to our development team. I will update you with their statement once we have a definitive answer.

To answer your question, I do not see a way to achieve this at the moment with the current API, but we will now consider treating this as a feature request and implementing it in our source code.

Regards,
Dilyan Traykov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Dilyan Traykov
Telerik team
answered on 22 Mar 2021, 03:49 PM

Hello Brandon,

After discussing this with our development team, we have the following proposition for your particular scenario:

As data sampling would not make sense when each point is its own group, you can change the ItemsSource of your series to the actual collection instead of using the ChartDataSource when the zoom level is big enough to see the individual data points. This will also avoid the other overhead required for constructing the data source, apart from the aggregations.

Please let us know if such an approach would work for you.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Brandon
Top achievements
Rank 1
Veteran
answered on 22 Mar 2021, 05:50 PM
Dilyan,

Thank you for the response.  I'm not quire sure how I would switch between the actual collection and the ChartDataSource when my zoom level changes.  I can see how I would do this when I zoom in enough that I want to use the actual collection, but how do I change the ItemsSource back to the ChartDataSource when I zoom back out a level that I want to use data sampling again?

Regards,

Brandon
0
Dilyan Traykov
Telerik team
answered on 24 Mar 2021, 03:00 PM

Hello Brandon,

I've prepared a small sample project where I've demonstrated how you can switch back and forth to the ChartDataSource depending on the zoom level which is applied.

Can you please have a look and let me know if a similar approach would work in your original application? I will be awaiting your reply.

Regards,
Dilyan Traykov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
ChartView
Asked by
Brandon
Top achievements
Rank 1
Veteran
Answers by
Brandon
Top achievements
Rank 1
Veteran
Dilyan Traykov
Telerik team
Share this question
or