Very long time on 10000 points

2 posts, 0 answers
  1. Raphael
    Raphael avatar
    1 posts
    Member since:
    Mar 2013

    Posted 05 Mar 2013 Link to this post

    Hi !

    I'm trying telerik charts and I wanted to test the performance. I saw the sample with 15000 points and I wanted to do the same with much more. Unfortunately, my computer got very hard to print a 10000 points line. I guess something is wrong with my code compared to the sample one but I don't really realise what.

    class DataListViewModel : ViewModelBase
        private RadObservableCollection<int> dataList;
        private Random random = new Random((int) DateTime.Now.Ticks);
        public DataListViewModel()
            this.Data = this.FillRandomlyList();
        public RadObservableCollection<int> Data
            get { return dataList; }
                if (value != dataList)
                    dataList = value;
        private RadObservableCollection<int> FillRandomlyList()
            var res = new RadObservableCollection<int>();
            for (int i = 0; i < 10000; i++)
            return res;

    <Window x:Class="PerfTest.MainWindow"
            Title="MainWindow" Height="350" Width="525" xmlns:telerik="">
            <telerik:RadCartesianChart Margin="12,12,270,12">
                    <telerik:CartesianChartGrid MajorLinesVisibility="XY" MajorXLineDashArray="5, 5" MajorYLineDashArray="5, 5">
                            <Style TargetType="Line">
                                <Setter Property="Shape.Stroke" Value="Gray" />
                            <Style TargetType="Line">
                                <Setter Property="Shape.Stroke" Value="Gray" />
                    <telerik:LinearAxis Visibility="Hidden"/>
                    <telerik:CategoricalAxis Title="Test2" Visibility="Visible" IsInverse="True" />
                    <telerik:ChartPanAndZoomBehavior />
                    <telerik:ChartSelectionBehavior />
                    <telerik:LineSeries Stroke="IndianRed" CategoryBinding="X" ValueBinding="Y"
                                        ItemsSource="{Binding Path=Data}" RenderMode="Light" >
                                <Ellipse Fill="DeepPink" Height="5" Width="5" />

    Does someone have an idea ?
    Thank you !

    Edit : It does the same without PointTemplate
  2. Petar Kirov
    Petar Kirov avatar
    425 posts

    Posted 08 Mar 2013 Link to this post

    Hi Raphael,

    Thanks for the attached code. I was able to quickly reproduce the issue.

    The main performance hit you are experiencing is caused by the excessive number of axis ticks and labels that are being generated. You can control this number by the MajorStep (for the LinearAxisand 
    MajorTickInterval (for the CategoricalAxis) properties. A suitable number for your test dataset is 1000.

    The second hit is actually caused by the PointTemplates. Most probably you did not notice it because, the Ticks/Labels problem had a much larger impact. 

    Give these recommendations a try and let us know how it goes.

    Petar Kirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft R3 2016 release webinar banner
Back to Top