Zoom and MarksTip

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Zoom and MarksTip

Post by acastro » Thu Mar 13, 2014 9:28 am

I don't undestand what happens in this example:
http://193.145.251.126/pnp/files/ZWgpDy ... chart3.zip

If you open it, you do zoom, and push button3 all is right. But if you uncomment in button3 the code which add the tool tip, when you press button3 the zoom changes.

Why the tooltip affectes the zoom?

Thanks

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Zoom and MarksTip

Post by Christopher » Thu Mar 13, 2014 3:43 pm

wakeup wrote:Why the tooltip affectes the zoom?
Because changing it's Style property causes a TChart invalidate. Try:

Code: Select all

        private void Form1_Load(object sender, EventArgs e)
        {
            tChart1.Aspect.View3D = false;
            tChart1.Series[0].FillSampleValues();
            tChart1.Zoomed += tChart1_Zoomed;
            tChart1.UndoneZoom += tChart1_UndoneZoom;
        }

        void tChart1_Zoomed(object sender, EventArgs e)
        {
          tChart1.AutoRepaint = false;
        }

        void tChart1_UndoneZoom(object sender, EventArgs e)
        {
          tChart1.AutoRepaint = true;
        }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Re: Zoom and MarksTip

Post by acastro » Fri Mar 14, 2014 9:33 am

Solved. Thanks a lot!

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Re: Zoom and MarksTip

Post by acastro » Mon Apr 07, 2014 10:36 am

I have detected, after do this change I cannot do two zooms, only the first run....

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Zoom and MarksTip

Post by Christopher » Mon Apr 07, 2014 2:13 pm

wakeup wrote:I have detected, after do this change I cannot do two zooms, only the first run....
Try:

Code: Select all

        private void Form1_Load(object sender, EventArgs e)
        {
            tChart1.Aspect.View3D = false;
            tChart1.Series[0].FillSampleValues();
            tChart1.Zoomed += tChart1_Zoomed;
            tChart1.UndoneZoom += tChart1_UndoneZoom;

            tChart1.MouseDown += tChart1_MouseDown;
        }

        void tChart1_MouseDown(object sender, MouseEventArgs e)
        {
          if (e.Button == tChart1.Zoom.MouseButton)
          {
            tChart1.AutoRepaint = true;
          }
        }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Re: Zoom and MarksTip

Post by acastro » Tue Apr 08, 2014 6:22 am

Thanks, it runs, but are not all these issues bugs?

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Zoom and MarksTip

Post by Christopher » Tue Apr 08, 2014 8:15 am

wakeup wrote:Thanks, it runs, but are not all these issues bugs?
No, they are not bugs, as this functionality is by design. Changing the value of the properties of TeeChart objects causes TeeChart to repaint itself, and on repainting the Zoom is reset. There is a way to keep track of Zoom movements, in fact, which is to use the Zoom.History property as can be seen in:

All Features -> Welcome !\Miscellaneous\Zoom and Scroll\Pen and Brush

%Program Files%\Steema Software\Steema TeeChart for .NET 2014 4.1.2014.02240\Examples\DemoProject\bin\ExecutableDemo\TeeChartNetExamples.exe
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Re: Zoom and MarksTip

Post by acastro » Tue May 27, 2014 7:38 am

Christopher wrote:
wakeup wrote:Why the tooltip affectes the zoom?
Because changing it's Style property causes a TChart invalidate. Try:

Code: Select all

        private void Form1_Load(object sender, EventArgs e)
        {
            tChart1.Aspect.View3D = false;
            tChart1.Series[0].FillSampleValues();
            tChart1.Zoomed += tChart1_Zoomed;
            tChart1.UndoneZoom += tChart1_UndoneZoom;
        }

        void tChart1_Zoomed(object sender, EventArgs e)
        {
          tChart1.AutoRepaint = false;
        }

        void tChart1_UndoneZoom(object sender, EventArgs e)
        {
          tChart1.AutoRepaint = true;
        }
With the last teechart version the problem is again here, and the autorepaint trick doesn't run.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Zoom and MarksTip

Post by Christopher » Tue May 27, 2014 7:59 am

wakeup wrote:With the last teechart version the problem is again here, and the autorepaint trick doesn't run.
Here is a video of the autorepaint trick working perfectly with the latest TeeChart version.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply