Page 1 of 1

Chart throws an InvalidOperationException

Posted: Tue May 25, 2010 9:43 am
by 8741807
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.

Re: Chart throws an InvalidOperationException

Posted: Wed May 26, 2010 11:32 am
by 10050769
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();
        }

Re: Chart throws an InvalidOperationException

Posted: Thu May 27, 2010 12:51 pm
by 8741807
Thanks, that did it!