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

Disabling DateTime sampling after applied

1 Answer 55 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Veteran
Brandon asked on 19 Mar 2021, 03:31 PM

Hello,

This is related to https://www.telerik.com/forums/samplingunit-of-none-does-not-disable-sampling, but I think a bit more specific of an issue.

I enable Data Sampling with a DateTime-based series by applying a ChartDataSourceStyle. Once I do this, sampling is always applied, even if my threshold allows all data points to be shown - it still goes through to sampling process.

 

I tried setting the ChartDataSourceStyle to null, expecting sampling to be disabled, but instead the previously-used sampling settings remained applied.  For instance, I may have my sampling set to a 5-minute interval, then when I zoom in to a small enough range to set the ChartDataSourceStyle to null, and my data remains sampled at 5-minute intervals.

 

When profiling my application, it appears that ChartSeriesDescriptor.OnChartDataSourceStyleChanged() ignores a change to a null style, and leaves the series descriptor bindings unchanged.  However, ChartSeriesDescriptor.BindItemsSource() does include a check for a null style, and if so binds directly to the ChartSeries rather than the ChartDataSource. Should the null check in ChartSeriesDescriptor.OnChartDataSourceStyleChanged() be removed?

 

Thanks,

 

Brandon

 

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 24 Mar 2021, 02:57 PM

Hello Brandon,

Instead of clearing the ChartDataSourceStyle property, in order to disable the sampling, I can suggest binding to the original data source, similarly to the other thread, which you referenced. I've prepared a small sample project to demonstrate how you can approach this in an MVVM-friendly manner.

Regarding your last question, I cannot confirm that removing the null-check would be sufficient and it is also possible that this can cause undesired behavior in other scenarios. You can log a new item in our feedback portal regarding this, but significant client demand would need to be observed for us to consider such an improvement in our source code.

Lastly, as the two threads are rather similar, may I kindly ask that we continue communication in only one of them, in order not to duplicate information and make it more helpful to our community? Thank you in advance for your cooperation and understanding.

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
Dilyan Traykov
Telerik team
Share this question
or