Jump to content
Software FX Community

Out of Memory Exception with Area chart


Recommended Posts

I am creating a simple chart and passing in data that has ~25 years of data.  This is a time series, so the chart is setup for an X-Values date scale.  If I show all of the data on the chart, it works fine.  However, if I limit the x-range to show less than the whole data set, I get this error, "Exception of type 'System.OutOfMemoryException' was thrown."  It works fine to do this with a line chart.  I can work around this by using a subset of my data that's within my x-axis min/max range, but I thought I would bring it to your attention.

My code example...


chart = new Chart();SeriesAttributes sa = new SeriesAttributes();sa.Gallery = Gallery.Area;sa.ItemsSource = sd.DataRaw;  //Data from 1986 to Presentsa.BindingPath = "Value";sa.BindingPathX = "Date";chart.AxisX.DataFormat.Format = AxisFormat.Date;chart.AxisX.Labels.Format = AxisFormat.Date;chart.AxisX.Min = new DateTime(1999, 1, 1);  //This causes OutOfMemoryException//chart.AxisX.Min = new DateTime(1986, 1, 1) <- This works, showing all the datachart.AxisX.Max = DateTime.Today;chart.AxisY.LogBase = 10.0;chart.AxisY.Min = min;chart.AxisY.Max = max;chart.AxisY.AxisStyle = AxisStyles.ShowEnds |   AxisStyles.ShowIntermediateLogLabels |   AxisStyles.AutoFirstLabel;chart.Series.Add(sa);


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...