Page 1 of 1

Zoom and MarksTip

Posted: Thu Mar 13, 2014 9:28 am
by 15654539
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

Re: Zoom and MarksTip

Posted: Thu Mar 13, 2014 3:43 pm
by Christopher
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;
        }

Re: Zoom and MarksTip

Posted: Fri Mar 14, 2014 9:33 am
by 15654539
Solved. Thanks a lot!

Re: Zoom and MarksTip

Posted: Mon Apr 07, 2014 10:36 am
by 15654539
I have detected, after do this change I cannot do two zooms, only the first run....

Re: Zoom and MarksTip

Posted: Mon Apr 07, 2014 2:13 pm
by Christopher
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;
          }
        }

Re: Zoom and MarksTip

Posted: Tue Apr 08, 2014 6:22 am
by 15654539
Thanks, it runs, but are not all these issues bugs?

Re: Zoom and MarksTip

Posted: Tue Apr 08, 2014 8:15 am
by Christopher
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

Re: Zoom and MarksTip

Posted: Tue May 27, 2014 7:38 am
by 15654539
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.

Re: Zoom and MarksTip

Posted: Tue May 27, 2014 7:59 am
by Christopher
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.