Hi
I think I'm seeing a regression in the current build with regards to the charts rendering performance. My example is mapping 24 data points on a line series. In the previous build I saw a slight freezing of the UI when initial rendering takes place (milliseconds although I never did any significant testing), now however I'm seeing a much longer freezing of the UI (nearly a second) while the chart is rendering which is causing a problem with my application as the users are constantly changing data and we wish for that to be immediately re-rendered on the chart but the UI freeze on the render makes it a difficult. I've got some test code below, if you press the refresh button you will see a noticiable freeze of the UI.
Any ideas, thoughts would be appreciated.
Thanks
Andy
public partial class Page : UserControl |
{ |
ObservableCollection<TestObject> testCollection; |
public Page() |
{ |
InitializeComponent(); |
testCollection = new ObservableCollection<TestObject>(); |
SeriesMapping SeriesMapping1 = new SeriesMapping(); |
SeriesMapping1.ItemMappings.Add(new ItemMapping("Value", DataPointMember.YValue)); |
SeriesMapping1.SeriesDefinition = new LineSeriesDefinition(); |
testChart.SeriesMappings.Add(SeriesMapping1); |
testChart.ItemsSource = testCollection; |
DefineData(); |
} |
private void DefineData() |
{ |
testCollection.Clear(); |
for (int i = 0; i < 23; i++) |
{ |
Random r = new Random(); |
testCollection.Add(new TestObject() { Value = r.Next(0, 20000) }); |
} |
} |
public class TestObject |
{ |
public double Value { get; set; } |
} |
private void Button_Click(object sender, RoutedEventArgs e) |
{ |
DefineData(); |
} |
} |
//xaml |
<UserControl x:Class="TelerikChartPerf.Page" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:telerikChart="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting" |
xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"> |
<Grid x:Name="LayoutRoot" Background="White"> |
<Grid.RowDefinitions> |
<RowDefinition Height="300" /> |
<RowDefinition Height="25" /> |
</Grid.RowDefinitions> |
<telerikControls:RadChart Grid.Row="0" Width="500" Height="300" x:Name="testChart" /> |
<Button Content="refresh" Grid.Row="1" Click="Button_Click" /> |
</Grid> |
</UserControl> |