OutOfMemoryException thrown in TeeChart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
jdsu
Newbie
Newbie
Posts: 22
Joined: Tue Jun 14, 2011 12:00 am

OutOfMemoryException thrown in TeeChart

Post by jdsu » Wed Nov 30, 2011 7:30 am

Hi,

I got the following exception followed by a big Red Cross in the chart when i am updating the FastLine with few hundreds of items and labels continuously. Is there any limit for the number of labels allowed in Teechart?
(I don't have any sample application that can duplicate the issue yet.)


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Collections.ArrayList.set_Capacity(Int32 value)
at System.Collections.ArrayList.EnsureCapacity(Int32 min)
at System.Collections.ArrayList.Add(Object value)
at Steema.TeeChart.Axis.DrawAxisLabel(ChartFont f, Int32 x, Int32 y, Int32 angle, String st, TextShape format, Boolean isTitle)
at Steema.TeeChart.Axis.DrawAxisLabel(ChartFont f, Int32 x, Int32 y, Int32 angle, String st, TextShape format)
at Steema.TeeChart.Axis.DrawAxisLabel(Int32 x, Int32 y, Int32 angle, String st, TextShape labelItem)
at Steema.TeeChart.Axis.AxisDraw.DrawThisLabel(Int32 labelPos, String tmpSt, TextShape labelItem)
at Steema.TeeChart.Axis.AxisDraw.AxisLabelsSeries(Rectangle rect)
at Steema.TeeChart.Axis.AxisDraw.Draw(Boolean calcPosAxis)
at Steema.TeeChart.Axis.Draw(Boolean calcPosAxis)
at Steema.TeeChart.Axes.Draw(Graphics3D g)
at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)
at Steema.TeeChart.Chart.InternalDraw(Graphics g)
at Steema.TeeChart.TChart.Draw(Graphics g)
at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: OutOfMemoryException thrown in TeeChart

Post by Sandra » Thu Dec 01, 2011 9:29 am

Hello jdsu,

I have made a simple project and it works fine in last version of TeeChart.Net and your exception doesn't appears:

Code: Select all

  public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        Steema.TeeChart.Styles.FastLine fastline1;
        private void InitializeChart()
        {
            fastline1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
            fastline1.FillSampleValues(1000);
            tChart1.Axes.Bottom.Labels.Items.Clear();
            for (int i = 0; i < fastline1.Count; i  )
            {
                tChart1.Axes.Bottom.Labels.Items.Add(fastline1.XValues[i]*10, (fastline1.XValues[i]*10).ToString());
            }

        }
        private void button1_Click(object sender, EventArgs e)
        {
          //  fastline1.Clear();
            
            fastline1.FillSampleValues(1000);
            tChart1.Axes.Bottom.Labels.Items.Clear();

            for (int i = 0; i < fastline1.Count; i  )
            {
                tChart1.Axes.Bottom.Labels.Items.Add(fastline1.XValues[i], (fastline1.XValues[i]).ToString());
            }
        }
Can you please, check if previous code works fine for you? If previous code doesn't work as you want and in it doesn't appears your problem, please modify code, because we try to reproduce the problem here and we can help you to solve it.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply