0

in my current project i have to visualize about 30.000 entries in a (telerik windows phone) chart control on mobile devices. Showing all of these entries slows down and blocks the UI for a few seconds.

My datasource is a list of "DataObject", where dateAndTime is the XAxis and the consumptionHT and consumptionNT are the YAxis.

(There are two different values, because for daytime consumptionHT is filled and consumptionNT is 0, for nighttime consumptionNT is filled and consumptionHT is 0. A solution for only one consumption value would be really helpful as well.)

public class DataOject
{
    public DateTime dateAndTime { get; set; }
    public float consumptionHT { get; set; }
    public float consumptionNT { get; set; }
}

I read something about algorithms like Ramer–Douglas–Peucker algorithm, but i don´t know if there is a better/more performant solution to reduce the size of list without loosing too many information (like extreme values).

Does anyone have a suggestion how to handle this problem? I am currently working with C# for Windows Universal App.

Kind regards, Robert

1 Answers1

0

You could use SamplingFunction and SamplingThreshold to solve this problem. Let us suppose you need only 200 datapoints instead of 30000 in the graph, then this could be done setting the SamplingThreshold to 200 (like below)

<telerikChart:RadChart.SamplingSettings>
    <telerikCharting:SamplingSettings SamplingThreshold="100" />
</telerikChart:RadChart.SamplingSettings>

It is up to you to decide how the trend of the other datapoints has to be shown in the graph. For instance if you want to show an average of the missed values (Data points) then you could do it like below:

<telerikChart:RadChart.SamplingSettings>
        <telerikCharting:SamplingSettings SamplingFunction="Average" SamplingThreshold="200" />
 </telerikChart:RadChart.SamplingSettings>

As like 'average' you could select the SamplingFunction to pick the Min,Max,Sum etc.. of the missed datapoints.

user3240361
  • 397
  • 1
  • 9
  • 1
    Thank you for your answer. I think in Windows Telerik for Universal App there is no RadChart Control. There´s only sth. called RadCartesianChart, but that chart does not have SamplingSettings. –  Mar 11 '15 at 11:25