SamplingThreshold with StepLineSeries

2 posts, 0 answers
  1. Trinh
    Trinh avatar
    1 posts
    Member since:
    Feb 2012

    Posted 12 Feb 2012 Link to this post


    I have a large dataset of digital values (1's and 0's) I wish to display, 10K+. To speed up the chart's responsiveness, I have enabled the SamplingThreshold, which results in a non-digital graph being displayed when the sampling is applied. Only when I zoom all the way in, so that the number of points displayed is less than the SamplingThreshold will I see the digital representation. Attached, are the images of what I mean.

    It appears, that sampling works well for analogue graphs but for digital ones (1's and 0's), it almost renders like aliasing effect.
    Is there a way to customize the sampling such that you see a digital style graph when the sampling is applied?

    Thanks in advance for your answer.

  2. Ves
    Ves avatar
    2914 posts

    Posted 15 Feb 2012 Link to this post

    Hi Trinh,

    The easiest way to achieve the desired result would be to wire ItemDataBound event of RadChart and update each DataPoint's YValue:

    void RadChart1_ItemDataBound(object sender, ChartItemDataBoundEventArgs e)
                if (e.DataPoint.YValue < 10)
                    e.DataPoint.YValue = 0;
                    e.DataPoint.YValue = 20;

    This way all DataPoints within the chart would have YValue either 0 or 20, which should serve your needs.

    Best regards,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top