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

Performance problem on line chart

6 Answers 253 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 01 Sep 2008, 06:23 PM
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;

6 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 03 Sep 2008, 02:52 PM
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.
0
Jurgen
Top achievements
Rank 1
answered on 23 Mar 2009, 08:33 AM
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
0
Ves
Telerik team
answered on 24 Mar 2009, 08:53 AM
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.
0
Jurgen
Top achievements
Rank 1
answered on 31 Mar 2009, 07:41 AM
I'll take a look at it in a week or so, but I haven't got much time right now.
0
Pawar
Top achievements
Rank 1
answered on 30 Apr 2012, 02:47 PM
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

 

0
Ves
Telerik team
answered on 03 May 2012, 11:47 AM
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.
Tags
Chart (Obsolete)
Asked by
Peter
Top achievements
Rank 1
Answers by
Ves
Telerik team
Jurgen
Top achievements
Rank 1
Pawar
Top achievements
Rank 1
Share this question
or