I have a page with a line chart of 9 series, each will have 360 points, so totally more than 3000 points. When I hard refresh this page, the cpu usage is raising from 12% to 70% then to 100%. I have Intel Core 2 Duo cpu with 3.16GHz, 8G memory, 64- bit Win7 system. Any suggestion for improvement is appreciated. I am using version 2012.2.626.40.
here is my code:
<telerik:RadChart ID="radchart1" runat="server" OnBeforeLayout="radchart1_OnBeforeLayout"
AutoLayout="true" Skin="Vista" IntelligentLabelsEnabled="false" PlotArea-XAxis-AutoScale="false" ><Legend Appearance-ItemTextAppearance-TextProperties-Font="Arial, 7pt" Appearance-ItemTextAppearance- AutoTextWrap="False"></Legend>
<ChartTitle TextBlock-Appearance-TextProperties-Font="Arial, 10pt, style=Bold"> </ChartTitle>
<PlotArea>
<XAxis>
<Appearance><TextAppearance TextProperties-Font="Arial, 8.25pt, style=Bold" />
<LabelAppearance RotationAngle="60"> </LabelAppearance>
</Appearance></XAxis>
<YAxis AxisMode="Extended" AutoScale="false">
<Appearance>
<TextAppearance TextProperties-Font="Arial, 8.25pt" />
</Appearance>
</YAxis>
</PlotArea>
</telerik:RadChart>
code to load chart series:
chartseries.Type = ChartSeriesType.Line;
chartseries.Appearance.PointMark.Visible = true;
chartseries.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid;
chartseries.Appearance.LabelAppearance.Visible = false;
for (int i = 0; i < data.Count(); i++){
if (radchart1.PlotArea.XAxis.Items.Count() < data.Count()) radchart1.PlotArea.XAxis.AddItem(data[i].Date.ToString());
chartseries.AddItem(Convert.ToDouble(data[i].Count) > 100 ? 101 : Convert.ToDouble(data[i].Count), data[i].Count.ToString());
chartseries.Items.Last().ActiveRegion.Tooltip = data[i].Count.ToString("#,##0");
}
function to customize xaxis labels
protected void radchart1_OnBeforeLayout(object sender, EventArgs e)
{
foreach (var item in radchart1.PlotArea.XAxis.Items)
{
DateTime xaxis = Convert.ToDateTime(item.TextBlock.Text);if (xaxis.Minute > 0)
{
item.Visible = false;
}
else{
item.TextBlock.Text = xaxis.ToString("h tt");
item.Visible = true;
}
}
}