When the cursorTool follows the mouse, the zoom box disappears.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Elite
Newbie
Newbie
Posts: 11
Joined: Tue Dec 03, 2019 12:00 am

When the cursorTool follows the mouse, the zoom box disappears.

Post by Elite » Wed Jan 08, 2020 9:48 am

Hello,
The cursorTool is set to follow the mouse, dashed box disappears when zooming.
I installed Steema.TeeChart.NET v4.2019.10.25 version.

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

Re: When the cursorTool follows the mouse, the zoom box disappears.

Post by Christopher » Thu Jan 09, 2020 10:10 am

Hello!

I'm afraid I'm having trouble reproducing this one here with the latest, publically available NuGet package for Windows Forms:
2020-01-09_10-56-17.gif
2020-01-09_10-56-17.gif (231.39 KiB) Viewed 13213 times
The code I used to produce the above image is this:

Code: Select all

        TChart _tChart;
        public Form1()
        {
            InitializeComponent();

            _tChart = new TChart();
            _tChart.Dock = DockStyle.Fill;

            _tChart.Series.Add(typeof(Line)).FillSampleValues();

            var cursor = (CursorTool)_tChart.Tools[_tChart.Tools.Add(typeof(CursorTool))];

            cursor.FollowMouse = true;

            _tChart.Header.Text = Utils.Version;

            this.Controls.Add(_tChart);
        }
Could you please modify the above code so I can reproduce your problem here? Please note that the repaint delay of the Chart in the gif is an artefact of the recording process and does not occur during normal use.
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

Elite
Newbie
Newbie
Posts: 11
Joined: Tue Dec 03, 2019 12:00 am

Re: When the cursorTool follows the mouse, the zoom box disappears.

Post by Elite » Thu Jan 09, 2020 11:53 am

I used the above code in a new project, and when I select the zoom area, there will be serious ghosting, like the gif you showed. When the mouse stops moving but the keys have not been raised, the zoom box disappears.
But when I set CursorTool not to follow the mouse movement, the above problem does not occur.

I use the following code

Code: Select all

public Form1()
{
	InitializeComponent();
	
	TChart tChart1 = new TChart();
	tChart1.Dock = DockStyle.Fill;
	
	tChart1.Series.Add(typeof(Line)).FillSampleValues();
	
	var cursor = (CursorTool)tChart1.Tools[tChart1.Tools.Add(typeof(CursorTool))];
	cursor.FollowMouse = true;

	Controls.Add(tChart1);
}

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

Re: When the cursorTool follows the mouse, the zoom box disappears.

Post by Christopher » Thu Jan 09, 2020 3:17 pm

As I say, I do not get the ghosting here, but that could be a function of the graphics cards in our respective machines.

At the same time, I think I can see what you mean - when you left-click on the chart and drag a zoom rectangle, the dashed rectangle is drawn but does not remain on the chart until the left mouse button is released, as it does when the CursorTool is not set to FollowMouse. This is because the CursorTool redraws itself to the new mouse position and so erases the dashed zoom rectangle. This is the expected behavior of the Chart as it is, although this does not mean that the behavior cannot be modified.
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