Dragging a color line has trailing line.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Srinivas Avancha
Newbie
Newbie
Posts: 41
Joined: Wed Jan 30, 2008 12:00 am

Dragging a color line has trailing line.

Post by Srinivas Avancha » Tue Jun 16, 2009 8:58 pm

Hi There,

How to achieve smooth dragging of color line?
Using the below code a trailing line is visible on dragging the color line, that is undesirable.

Best Regards
Srinivas Avancha

Code: Select all

        private void Form1_Load(object sender, EventArgs e)
        {

            Steema.TeeChart.TChart tChart1 = new Steema.TeeChart.TChart();
            this.Controls.Add(tChart1);
            tChart1.Dock = DockStyle.Fill;
            tChart1.Aspect.View3D = false;

            Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            line1.FillSampleValues(2);
            line1.LinePen.Width = 3;

            Steema.TeeChart.Tools.ColorLine colorLine = new Steema.TeeChart.Tools.ColorLine(tChart1.Chart);
            colorLine.Active = true;
            colorLine.Axis = tChart1.Axes.Left;
            colorLine.Pen.Color = Color.Black;
            colorLine.Pen.Width = 2;
            colorLine.Pen.Style = System.Drawing.Drawing2D.DashStyle.Dash;

            colorLine.Value = (tChart1.Axes.Left.MaxYValue - tChart1.Axes.Left.MinYValue) / 2 + tChart1.Axes.Left.MinYValue;

        }


Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Dragging a color line has trailing line.

Post by Sandra » Wed Jun 17, 2009 8:23 am

Hello Srinivas Avancha,

Please add next line in your code and check that works fine:

Code: Select all

    colorLine.DragRepaint = true;
I hope that will helps,


Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Srinivas Avancha
Newbie
Newbie
Posts: 41
Joined: Wed Jan 30, 2008 12:00 am

Re: Dragging a color line has trailing line.

Post by Srinivas Avancha » Wed Jun 17, 2009 12:32 pm

Hi Sandra,

It did work like a charm! But I thought it is counter intuitive as the documentation states “Repaints the Chart while moving the ColorLine when DragRepaint is True” should cause more delay, what is the logic behind?

Thanks.

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Dragging a color line has trailing line.

Post by Yeray » Wed Jun 17, 2009 2:46 pm

Hi Srinivas Avancha,

The problem isn't a real delay but looks if it was. If the chart draws the line in the new position without repainting the whole chart, the line drawn in the old position isn't removed. I mean, when the chart is repainted, all the old lines disappear and then the line is drawn in the new position.

Of course, forcing the chart to be repainted more times is slower but if you don't have much points, you won't note any difference.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Srinivas Avancha
Newbie
Newbie
Posts: 41
Joined: Wed Jan 30, 2008 12:00 am

Re: Dragging a color line has trailing line.

Post by Srinivas Avancha » Wed Jun 17, 2009 2:50 pm

Hi Yeray,

Thanks for the explanation.

Post Reply