Performance problem on line chart

Thread is closed for posting
7 posts, 0 answers
  1. Peter Kellner
    Peter Kellner avatar
    17 posts
    Member since:
    Jul 2007

    Posted 01 Sep 2008 Link to this post

    I'm wondering if there is something I can do to make the line chart go a lot faster.  I have a couple thousand points I want to plot and use the code below.  It takes almost 15 seconds to make the graph.  When I cut the number of points to plot to 200, it takes less than a second.  Here is the code I'm using

    ChartSeries chartSeries = new ChartSeries("Altitude", ChartSeriesType.Line);

    chartSeries.Appearance.ShowLabels =

    false;

    incrementCount = 1;

    for (int i = 0; i < listData.Count; i = i + incrementCount)

    {

    chartSeries.AddItem(

    new ChartSeriesItem(listData[i].x, listData[i].y));

    }

    RadChart2.AddChartSeries(chartSeries);

    RadChart2.ChartTitle.TextBlock.Text = title;

    RadChart2.PlotArea.XAxis.AxisLabel.TextBlock.Text =

    "Distance (Miles)";

    RadChart2.PlotArea.XAxis.AxisLabel.Visible =

    true;

    RadChart2.PlotArea.XAxis.IsZeroBased =

    true;

    RadChart2.PlotArea.YAxis.AxisLabel.TextBlock.Text = yAxisLabel;

    RadChart2.PlotArea.YAxis.AxisLabel.Visible =

    true;

    RadChart2.PlotArea.YAxis.IsZeroBased =

    false;

  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 03 Sep 2008 Link to this post

    Hi Peter,

    RadChart will have problems when it comes to thousands of items on screen. While the product was designed to be easily customizable and feature rich it does not cope well with extremely busy charts. We are continually improving performance as we go but still the bottom line is that the control is targeted for casual situations which do not require a high performance solution. There is a trade off to make between high customization and high performance and we've gone the rich features path as it is what most of our customers are interested in.

    A workaround would be to filter the data i.e. combine several datapoints in one chart item, of course I understand this is not always applicable. Another possible workaround is to load the page without the chart and use RadAjax to show a loading panel while loading the chart asynchronously. The following help topics and online example might be helpful:
    Please, accept our apologies for the inconvenience.

    Best regards,
    Ves
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jurgen
    Jurgen avatar
    7 posts
    Member since:
    Jan 2009

    Posted 23 Mar 2009 Link to this post

    I was facing the same problem.

    A linechart with app. 200 points took about 30 seconds to load. When I disabled the clientside zooming, it does the trick in less than 2 seconds. Sad actually, because the zooming is most needed in heavily populated charts.

    Maybe an issue that needs some attention?


    Grtz
  5. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 24 Mar 2009 Link to this post

    Hello Jurgen,

    Can you please provide more details about your specific implementation? I have attached a small page, showing RadChart with zoom/scroll enabled, 1 line series with 200 points. Render takes less than a second. Can you confirm it works the same way for you?

    Regards,
    Ves
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Jurgen
    Jurgen avatar
    7 posts
    Member since:
    Jan 2009

    Posted 31 Mar 2009 Link to this post

    I'll take a look at it in a week or so, but I haven't got much time right now.
  7. Pawar
    Pawar avatar
    15 posts
    Member since:
    Apr 2012

    Posted 30 Apr 2012 Link to this post

    Hi Peter/Telerik Team,

               I've been working on the above development. Peter's posted code perfectly works for me.
               Am not understanding, how his code "ChartSeriesItem(listData[i].x, listData[i].y)); " Is getting the data.
               Is this datalist or which kind of data holder it is. If you guys provide some sample expample that would be great.

               I've been trying to development my code in the below way, but it is not working and throughing some error at line.

     

     

    Dim listdata As new DataList

     

    listdata.DataSource = ds.Tables.Item(0)

    listdata.DataBind()

    radchart.Clear()

     

     

     

    Dim chartSeries As New ChartSeries("Baseline", ChartSeriesType.Line)

     

    chartSeries.Appearance.ShowLabels =

     

    False

     

     

     

    Dim i As Integer = 0

     

     

     

    While i < ds.Tables(0).Rows.Count

     

     

     

         chartSeries.AddItem(New ChartSeriesItem(listdata(i).("COUNT"),listdata(i).("CapacityDelay") ))
         //throughing an error as per the screen shot.

     

         i = i + 1

     

     

    End While

     

    radchart.AddChartSeries(chartSeries)

    radchart.ChartTitle.TextBlock.Text = title

    radchart.PlotArea.XAxis.AxisLabel.TextBlock.Text = xaxislableName

    radchart.PlotArea.XAxis.AxisLabel.Visible =

     

    True

     

    radchart.PlotArea.XAxis.IsZeroBased =

     

    False

     

    radchart.PlotArea.YAxis.AxisLabel.TextBlock.Text = yaxislableName

    radchart.PlotArea.YAxis.AxisLabel.Visible =

     

    True

     

    radchart.PlotArea.YAxis.IsZeroBased =

     

    True

     

  8. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 03 May 2012 Link to this post

    Hey,

    The VB indexing syntax expects '(i)'  rather than '[i]' .

    Greetings,
    Ves
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017