Page 1 of 1

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

Posted: Wed Jan 08, 2020 9:48 am
by 15687497
Hello,
The cursorTool is set to follow the mouse, dashed box disappears when zooming.
I installed Steema.TeeChart.NET v4.2019.10.25 version.

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

Posted: Thu Jan 09, 2020 10:10 am
by Christopher
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 12697 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.

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

Posted: Thu Jan 09, 2020 11:53 am
by 15687497
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);
}

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

Posted: Thu Jan 09, 2020 3:17 pm
by Christopher
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.