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
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:
- http://www.telerik.com/help/aspnet-ajax/ajxshowloadingpaneloninitialpageload.html
- http://www.telerik.com/help/aspnet-ajax/ajxclientsideapi.html
- http://demos.telerik.com/ASPNET/Prometheus/Ajax/Examples/Manager/ClientSideAPI/DefaultCS.aspx
Best regards,
Ves
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
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
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.
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
The VB indexing syntax expects '(i)' rather than '[i]' .
Greetings,
Ves
the Telerik team