Chart throws an InvalidOperationException

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
ctusch
Newbie
Newbie
Posts: 11
Joined: Tue Sep 25, 2007 12:00 am
Contact:

Chart throws an InvalidOperationException

Post by ctusch » Tue May 25, 2010 9:43 am

Hello,

while I was trying to reproduce another problem I'm having with TeeChart, I stumbled across this one. The example has been tested with version 3.5.3700.30575. It should throw the exception a few seconds after start-up. When setting AutoRepaint to false I had to resize the window to get the same behavior.

Am I doing something wrong?

EDIT: I also tried to invoke the code in the timer event handler and using .Refresh instead of .Draw but then it starts hanging after resizing the chart for some time.
Attachments
TeeChartExample.zip
(9.29 KiB) Downloaded 302 times

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

Re: Chart throws an InvalidOperationException

Post by Sandra » Wed May 26, 2010 11:32 am

Hello ctush,

Please, check if next code works as you want in your application. If problem still appears, please could you explain which steps we have followed for reproduce your problem here?

Code: Select all

        void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            lock(this.chartLock)
            {
                for(int i = 0; i < this.lines.Length; i++)
                {
                    this.lines[i].Add(DateTime.Now, this.random.NextDouble() * 200.0);
                }

               
            }
            this.tChart.Invalidate();
        }
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

ctusch
Newbie
Newbie
Posts: 11
Joined: Tue Sep 25, 2007 12:00 am
Contact:

Re: Chart throws an InvalidOperationException

Post by ctusch » Thu May 27, 2010 12:51 pm

Thanks, that did it!

Post Reply