UI freezes when loading large amount of data
I have an observable collection that I am binding to a LineSeries. This collection contains a large amount of data 5000+ points.
if (!e.IsScrolling && e.ActualMaximum != null)
{
e.VisibleMinimum = (double)e.ActualMaximum - 200d;
}
When the graph loads the collection it freezes the UI, for a considerable amount of time, while it plots the points.
I am using the scroll view, so only 200 points are shown and you can scroll backwards to see the others. I would expect this to minimize the plotting time?
Is there some performance stuff I am missing or not doing properly?
Is there a better way I can load a large amount of data into the graph without blocking the UI completely for a long period of time?
Another issue, although I think related to the amount of data, is that the scroll view is very laggy and also the x axis legend labels disappear when scrolling backwards.
Below I have included some code snippets to help explain my problem.
Many thanks for your help.
CODE
public Graph()
{
this.InitializeComponent();
this.Points = new ObservableCollection<ChartPoint>();
XAxis.ActualRangeChanged += XAxis_ActualRangeChanged;
...
series1 = new LineSeries();
series1.XBindingPath = "Date";
series1.YBindingPath = "X";
series1.ItemsSource = this.Points;
series1.ShowTooltip = true;
series1.EnableAnimation = false;
series1.Label = "X Data";
chart.Series.Add(series1);
...
}
private void XAxis_ActualRangeChanged(object sender, ActualRangeChangedEventArgs e)
{if (!e.IsScrolling && e.ActualMaximum != null)
{
e.VisibleMinimum = (double)e.ActualMaximum - 200d;
}
}
XAML
<chart:SfChart x:Name="chart" Grid.Row="1" Grid.ColumnSpan="3" Margin="0,0,15,0">
<chart:SfChart.Header>
<TextBlock x:Name="header" FontSize="20" FontFamily="Segoe UI" Margin="0,0,0,20">
Chart Header
</TextBlock>
</chart:SfChart.Header>
<chart:SfChart.Legend>
<chart:ChartLegend x:Name="legend"></chart:ChartLegend>
</chart:SfChart.Legend>
<chart:SfChart.PrimaryAxis>
<chart:CategoryAxis x:Name="XAxis"
EnableScrollBarResizing="False"
EnableTouchMode="True"
EnableScrollBar="True"
Header="Time"
LabelFormat="HH:mm:ss"
EdgeLabelsDrawingMode="Fit">
</chart:CategoryAxis>
</chart:SfChart.PrimaryAxis>
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis></chart:NumericalAxis>
</chart:SfChart.SecondaryAxis>
</chart:SfChart>
SIGN IN To post a reply.
3 Replies
MK
Muneesh Kumar G
Syncfusion Team
September 18, 2015 01:06 PM UTC
Hi Andrew,
Thanks for using Syncfusion products.
We can achieve your requirement by using FastLineBitmapSeries, it provides better performance when loading large amount of data. We have created sample with more than 5000 points. Please find the sample from the following location.
Sample: http://www.syncfusion.com/downloads/support/forum/120288/ze/Sample1582321444
Please let us know if you have any queries.
Thanks,
Muneesh Kumar G.
Thanks for using Syncfusion products.
We can achieve your requirement by using FastLineBitmapSeries, it provides better performance when loading large amount of data. We have created sample with more than 5000 points. Please find the sample from the following location.
Sample: http://www.syncfusion.com/downloads/support/forum/120288/ze/Sample1582321444
Please let us know if you have any queries.
Thanks,
Muneesh Kumar G.
AN
Andrew
September 18, 2015 03:41 PM UTC
Hi Thank you for the reply.
Attachment: Capture_1f680c68.7z
I have implemented my graphs as you suggested, as a FastLineSeries.
It does load the data very fast, however not far into the data the graph starts to become blurred, as can be seen in the screenshot attached.
Any ideas why it is blurred?
Many thanks for the help.
Attachment: Capture_1f680c68.7z
RA
Rachel A
Syncfusion Team
September 21, 2015 12:25 PM UTC
Hi Andrew,
Thanks for the update.
We are unable to reproduce the problem. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents
Regards,
Rachel
Thanks for the update.
We are unable to reproduce the problem. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents
Regards,
Rachel
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
-
AN Andrew
- Sep 17, 2015 02:43 PM UTC
- Sep 21, 2015 12:25 PM UTC