TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
-
Srinivas Avancha
- Newbie
- Posts: 41
- Joined: Wed Jan 30, 2008 12:00 am
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
- Posts: 3132
- Joined: Fri Nov 07, 2008 12:00 am
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:
I hope that will helps,
Thanks,
-
Srinivas Avancha
- Newbie
- Posts: 41
- Joined: Wed Jan 30, 2008 12:00 am
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
- Posts: 9614
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
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.