Page 1 of 1

Possible bug - FastLine with same Y-value

Posted: Wed Apr 18, 2007 11:50 am
by 9643849
I'm drawing a FastLine (haven't tested if the same goes for Line) on a chart. The FastLine consists of a number of "points" with different X values (dates), but the same Y-value (a double value).

When the line is initially drawn, everything looks fine, but if I zoom or hold down the middle mousebutton to move around on the chart, the Y-axis is messing up. I guess you will be able to reproduce the scenario pretty easy, but if you don't I can provide you with my code and a picture.

By the way, I'm using TeeChart for .Net v 2.0.2586.24039

Regards Andreas

Posted: Mon Apr 23, 2007 11:16 am
by narcis
Hi Andreas,

This is not a bug. However, this is a special case where left axis range is zero since the maximum and minimum values are zero. Thus when zooming and drawing the labels, as range is zero they are drawn as you say. One way to easily solve that is manually setting left axis minimum and maximum values:

Code: Select all

			Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
			for (int i = 0; i < 10; i++)
			{
				line1.Add(5);
			}

			//tChart1.Axes.Left.SetMinMax(4, 6);
			tChart1.Axes.Left.SetMinMax(line1.MinYValue() - 1, line1.MaxYValue() + 1);