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

SamplingThreshold with StepLineSeries

1 Answer 61 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Trinh
Top achievements
Rank 1
Trinh asked on 13 Feb 2012, 01:35 AM
Hello,

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.

Cheers
Trinh.

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 15 Feb 2012, 12:58 PM
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;
            else
                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,
Ves
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Chart
Asked by
Trinh
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or