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

[Solved] Size of LineSeries collection

2 Answers 54 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Steven
Top achievements
Rank 1
Steven asked on 20 Jul 2014, 04:59 PM
Is there some kind of limit on how many points can be in a LineSeries?

I have two lineseries on my chart and I am noticing that at some threshold one of the lines will stop half way across the chart. After fiddling around, I tried reducing the number of points by removing every 2nd and 3rd point and found that the line would then be drawn all the way.

What is the limit? Is it adjustable?

2 Answers, 1 is accepted

Sort by
0
Steven
Top achievements
Rank 1
answered on 20 Jul 2014, 05:01 PM
Sorry, my mistake. The LineSeries is fine. The second line is actually a SplineSeries, and that is the one that is truncated.
0
Ves
Telerik team
answered on 24 Jul 2014, 07:02 AM
Hi Steven,

The only limit comes from the xaml itself -- plotting hundreds of thousands of points would lead to performance issues. However, missing part of the line is not something expected and we are not currently aware of such an issue. I have attached a screenshot of a chart with spline series with 10000 points. It is just a simple example based on the following code:

<telerikChart:RadCartesianChart x:Name="chart">
    <telerikChart:RadCartesianChart.HorizontalAxis>
        <telerikChart:DateTimeContinuousAxis MajorStepUnit="Day" MajorStep="2"  />
    </telerikChart:RadCartesianChart.HorizontalAxis>
    <telerikChart:RadCartesianChart.VerticalAxis>
        <telerikChart:LinearAxis></telerikChart:LinearAxis>
    </telerikChart:RadCartesianChart.VerticalAxis>
    <telerikChart:SplineSeries>
        <telerikChart:SplineSeries.ValueBinding>
            <telerikChart:PropertyNameDataPointBinding PropertyName="Value"/>
        </telerikChart:SplineSeries.ValueBinding>
        <telerikChart:SplineSeries.CategoryBinding>
            <telerikChart:PropertyNameDataPointBinding PropertyName="Date"/>
        </telerikChart:SplineSeries.CategoryBinding>
    </telerikChart:SplineSeries>
</telerikChart:RadCartesianChart>
 
and

List<DataItem> source = new List<DataItem>();
Random r = new Random();
 
for (int i = 0; i < 10000; i++)
{
    source.Add(new DataItem(DateTime.Now.AddMinutes(i), r.Next(100)));
}
this.chart.Series[0].ItemsSource = source;

where the DataItem class looks like this:

public class DataItem
{
    public DataItem(DateTime date, double value)
    {
        this.Date = date;
        this.Value = value;
    }
    public DateTime Date { get; set; }
    public double Value { get; set; }
}

Can you confirm if it works correctly for you? If so, can you please, modify it or provide another example, which reproduces the problem, so that we can investigate it and get back to you?

Best regards,
Ves
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Chart for XAML
Asked by
Steven
Top achievements
Rank 1
Answers by
Steven
Top achievements
Rank 1
Ves
Telerik team
Share this question
or