Hi,
We consistently get an "Out of memory." error when using GradientMode in a Pie Chart.
No panic - we simply comment out this line
and all is fine. The maximum # of items loaded in the series is 14.
Hope it's not something we're doing wrong! :-)
Cheers ..
We consistently get an "Out of memory." error when using GradientMode in a Pie Chart.
No panic - we simply comment out this line
csi.Appearance.FillStyle.FillSettings.GradientMode = Telerik.Charting.Styles.GradientFillStyle.Center; |
and all is fine. The maximum # of items loaded in the series is 14.
Hope it's not something we're doing wrong! :-)
Cheers ..
// .aspx |
<telerik:RadChart ID="uxBreakup" runat="server" Width="700px" Height="450px"> |
<ChartTitle> |
<TextBlock Text="Recent Listings Category Breakup" /> |
</ChartTitle> |
</telerik:RadChart> |
<telerik:RadChart ID="uxAllBreakup" runat="server" Width="700px" Height="450px"> |
<ChartTitle> |
<TextBlock Text="All Listings Category Breakup" /> |
</ChartTitle> |
</telerik:RadChart> |
//--------------------------------------------------------------------------------------- |
// .aspx.cs |
public void BreakupReport() |
{ |
DoBreakupReport(uxBreakup, reportStartDate, reportEndDate, "Breakup of Recent Listings"); |
DoBreakupReport(uxAllBreakup, new DateTime(2000, 1, 1), new DateTime(2999, 1, 1), "Breakup of All Listings"); |
} |
public void DoBreakupReport(RadChart uxChart, DateTime start, DateTime finish, string title) |
{ |
Color[] colors = { Color.FromArgb(40, 0, 187, 239), Color.FromArgb(0, 187, 239), |
Color.FromArgb(40, 15, 191, 15), Color.FromArgb(15, 191, 15), |
Color.FromArgb(40, 255, 179, 62), Color.FromArgb(255, 179, 62), |
Color.FromArgb(40, 255, 79, 0), Color.FromArgb(255, 79, 0) }; |
uxChart.Clear(); |
ChartSeries csBreakup = uxChart.CreateSeries("Breakup", System.Drawing.Color.Goldenrod, System.Drawing.Color.Goldenrod, ChartSeriesType.Pie); |
using (FetchSQL sql = new FetchSQL(string.Format("SELECT c.CategoryName, Count(*) FROM vwclassifiedadverts a inner join classifiedcategories c on a.ParentCategoryID=c.CategoryID " + |
"WHERE StartUTC BETWEEN {0} AND {1} GROUP BY c.CategoryName ORDER BY c.CategoryName", |
DB.MySqlDateTime(start), DB.MySqlDateTime(finish)))) |
{ |
int i = 0; |
while (sql.Read()) |
{ |
ChartSeriesItem csi = new ChartSeriesItem(sql.AsInteger(1)); |
csi.Label.TextBlock.Text = sql.AsString(0) + " - #%"; |
csi.Name = sql.AsString(0); |
csi.Appearance.FillStyle.MainColor = colors[i * 2]; |
csi.Appearance.FillStyle.SecondColor = colors[i * 2 + 1]; |
csi.Appearance.Border.Color = Color.DimGray; |
csi.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Gradient; |
// .. this GradientFillStyle causes "OUt of Memory" |
csi.Appearance.FillStyle.FillSettings.GradientMode = Telerik.Charting.Styles.GradientFillStyle.Center; |
csBreakup.Items.Add(csi); |
i = (++i) % 4; |
} |
} |
uxChart.ChartTitle.TextBlock.Text = title; |
} |
//--------------------------------------------------------------------------------------- |
[OutOfMemoryException: Out of memory.] |
System.Drawing.Drawing2D.PathGradientBrush..ctor(GraphicsPath path) +171505 |
Telerik.Charting.RenderEngine.GetGradientBrush(RectangleF rect, FillStyle fill) +1673 |
Telerik.Charting.RenderEngine.GetBrush(FillStyle fill, RectangleF rect) +963 |
Telerik.Charting.RenderEngine.RenderPieSeries(ChartSeries series, Int32 seriesIndex) +2322 |
Telerik.Charting.RenderEngine.Render(ChartSeries series, Int32 index) +639 |
Telerik.Charting.RenderEngine.RenderPlotAreaElements(Boolean withGrid, Boolean withTicks) +861 |
Telerik.Charting.RenderEngine.Render(IContainer element) +263 |
Telerik.Charting.Chart.GetImage(Int32 width, Int32 height) +405 |
[ChartException: An Unexpected error has occurred. Please review the InnerException for more information how to resolve the problem.] |
Telerik.Charting.Chart.GetException(RenderEngine renderEngine, Exception ex) +455 |
Telerik.Charting.Chart.GetImage(Int32 width, Int32 height) +639 |
Telerik.Web.UI.RadChart.RenderClassic(HtmlTextWriter writer) +166 |
Telerik.Web.UI.RadChart.RenderContents(HtmlTextWriter writer) +351 |
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +29 |
Telerik.Web.UI.RadDataBoundControl.Render(HtmlTextWriter writer) +9 |
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 |
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 |
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 |
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130 |
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24 |
System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +7 |
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +29 |
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 |
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 |
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 |
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130 |
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24 |
System.Web.UI.Control.Render(HtmlTextWriter writer) +7 |
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 |
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 |
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 |
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130 |
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24 |
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +59 |
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +68 |
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 |
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 |
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +37 |
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130 |
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24 |
System.Web.UI.Control.Render(HtmlTextWriter writer) +7 |
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 |
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 |
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 |
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130 |
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24 |
System.Web.UI.Page.Render(HtmlTextWriter writer) +26 |
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 |
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 |
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 |
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1896 |