KeepExtremes sampling function is not keeping extremes

2 posts, 0 answers
  1. Erik
    Erik avatar
    1 posts
    Member since:
    Jan 2012

    Posted 10 Dec 2012 Link to this post

    I have created a RadChart that is accepting a lot of data. For the test I am currently trying, it has 170,000 records coming in that I am trying to graph with a line series.

    The chart has the following properties:

    <control:RadChart x:Name="FlightGraph" UseDefaultLayout="False">


                  <chart:SamplingSettings SamplingThreshold="5000" SamplingFunction="KeepExtremes" />


           <chart:ChartArea x:Name="FlightGraphArea" EnableAnimations="False">

           <!--   <chart:ZoomScrollSettings ScrollMode="ScrollAndZoom"/>-->




    I am having difficulties with the sampling. If I don’t use it, the entire chart grinds to a halt under the massive amount of rendering it needs to do. However, the sampling function does not appear to work as I would expect.

    When the chart is displayed, the highest value it shows in 1.176. However, there are values of 1.25 in close proximity. If I zoom in to the points where I know they are, then they show up. But I do not understand why I have to do that. With the KeepExtremes sampling function, I would assume that the highest value would be the one to show up.

    Can anyone explain this? Is there a way to get this working?

  2. Ves
    Ves avatar
    2870 posts

    Posted 13 Dec 2012 Link to this post

    Hi Erik,

    KeepExtremes actually returns either the minimum or the maximum in the current sample. Which value will be returned depends on the average -- the one that is farther from the average will be used. So, in this very case, please check if the average is closer to the maximum. This would cause the effect you have observed. When zooming in, the sample size is decreased and it is possible that the average is closer to the minimum, so you see the value you expect. If you need to use the max value all the time, please use ChartSamplingFunction.Max instead.

    Best regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top