Page 1 of 1

Cursor Tool and zooming

Posted: Wed Mar 25, 2009 9:57 am
by 14045263
I have a CursorTool added onto the chart, and I have set the zoom box to have a solid fill colour and a dash border.

If you then try and zoom, the zoom box flickers and then eventually disappears when you let go of the mouse.

If you uncomment out the FastCursor line it works perfectly.

Any ideas?!

I have put the code below.

Code: Select all

            InitializeComponent();

            tChart1[0].FillSampleValues(9000);
            tChart1[1].FillSampleValues(9000);
            tChart1[2].FillSampleValues(9000);
            tChart1[3].FillSampleValues(9000);

            new CursorTool(tChart1.Chart)
            {
                Style = CursorToolStyles.Vertical,
                FollowMouse = true, 
                //FastCursor = true,
                Series = tChart1[0]
            };

            tChart1.Zoom.MinPixels = 3;
            tChart1.Zoom.Brush.Color = Color.Green;
            tChart1.Zoom.Pen.Style = System.Drawing.Drawing2D.DashStyle.Dash;
Regards,
Chris.

Posted: Wed Mar 25, 2009 11:47 am
by yeray
Hi Chris,

As you've noticed, the problem is not the zoom but the cursor. If you add the line "tChart1.Zoom.Allow = false;" you'll see that the cursor flicker.

The problem is that with every time the cursor is moved, the chart needs to be repainted and this is a chart with a large amount of data. And setting FastCursor to true, this tool gets a lot of optimizations.

Posted: Mon Mar 30, 2009 8:41 am
by 14045263
thanks Yeray!