Edit this page


The sampling feature is supported only in a data binding scenario.

The 3D chart supports index-based sampling. For a given set of business objects the sampling engine creates a subset of data point models (DataPoint3D). Each data point model is created by combining a number of business objects based on the sampling threshold. The value of the created data point is determined by the sampling function. The default aggregate function of the sampling feature is Average.

ChartDataSource is the class used to apply sampling on the original data. The class exposes a SamplingThreshold property that determines the minimum number of business objects in the ItemsSource required to apply sampling.

ChartDataSource implements the IEnumerable interface which allows you to assing it to the ItemsSource property of a chart 3D series.

[XAML] Example 1: Setting ChartDataSource

    <telerik:ChartDataSource x:Name="chartDataSource" ItemsSource="{Binding Items}" SamplingThreshold="10" />
            <telerik:BarSeries3D XValueBinding="XValue"                              
                                 ItemsSource="{Binding ElementName=chartDataSource}"/>

Let's say that the original set of data from Example 1 called "Items" contains 100 items. With SamplingThreshold set to 10, the chart will try to create 10 DataPoint3D models and add them to the DataPoints collection of the series.

The ChartDataSource class exposes also SamplingUnit and SamplingUnitInterval properties. They are not supported by the 3D chart series. Also, currently the sampling works with average function which means that the sampling is supported only in scenarios with numeric axes (LinearAxis3D).

See Also