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

chart question - rendering time

1 Answer 126 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John Even
Top achievements
Rank 1
John Even asked on 09 Mar 2009, 09:08 AM
Hi, we are evaluating Telerik Reporting, and have come across a few problems using the Chart.

First what I'm trying to accomplish:
A simple barchart, where the data is DateTime on the x-axis and integer og the y-axis.
The chart must also display Time in a realistic matter. 
The code is in the chart1_NeedDataSource(..,..) eventhandler.

When I am binding an ArrayList with approx 40 items the report takes about 2 seconds to render.
However if the ArrayList is 250 items the report takes about 45 seconds!! to render.
If I set the x-axis labels manually to empty strings it seems to go about a few seconds faster.

The ArrayList contains a custom class with 2 properties with datatypes DateTime and Integer.
For instance if I originally have an ArrayList with only 2 items, and the datetimes are yy-mm-dd 09:45:00 and yy-mm-dd 09:57:00
then i create an ArrayList with all the minutes between 45 and 57 (Integer=0), and thus have an ArrayList with 13 items.

Retrieving data and manipulating ArrayList takes basically no time at all.

How I bind:
al = db.getChartData();
//al = fillEmptyMinutes(al);   //
((Telerik.Reporting.Processing.Chart)sender).DataSource = al;

Telerik.Reporting.Processing.Chart chartItem = sender as Telerik.Reporting.Processing.Chart;
Telerik.Reporting.Chart chart = (Telerik.Reporting.Chart)chartItem.ItemDefinition;


chart1.Series[0].PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 270;
            
//chart.PlotArea.XAxis.AutoScale = false;
//chart.PlotArea.XAxis.AutoShrink = false;
//chart.PlotArea.XAxis.Clear();
//for (int i = 0; i < al.Count; i++)
//{
    //  chart.PlotArea.XAxis.AddItem(" ");
//}


Is the another more effecient way to display time-data like this?
In a perfect world I just want to send in the original ArrayList and set for instance
chart.Series[0].XAxis.DataType = DateTime; // or even DateTime.Minutes
Are there some other properties on the chart that can improve renderingtime?

I am using Q3 2008-version

Regards, John Pedersen



1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 12 Mar 2009, 12:51 PM
Hello John Even,

How many items do you have in the chart? RadChart will have problems with more than 1000 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.
The chart item has no intrinsic support for DateTime values. To show DateTime values the chart expects a data source of doubles which are internally converted to DateTime using DateTime.ToOADate() method.

What we would recommend is to change your data source and make the 'Date' column of type double. This column should be populated with values representing the OLE Automation equivalent of your DateTime values. Or you can do this directly in the query, here is an example of a sql query, which will convert the DateTime values to their OLE automation equivalents:

"SELECT [Temperature], CAST([Date] AS FLOAT) + 2 as float_date FROM [Table_1]"


Please excuse us for the inconvenience.

Sincerely yours,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
John Even
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or