Page 1 of 1

Bug Axis Start/End Position with Units = Pixels

Posted: Thu Jul 12, 2007 2:33 pm
by 13046026
Hi,

Axis positioning does not work in TeeChart V3 build 12.July 2007
if Units="Pixels" is selected.

Result:
Axis height is not absolutely positioned. (try to resize the window).


Reproduce:
- Choose Left Axis in TeeChart Editor.
- Set Position Units to "Pixels"
- Set Position to 0
- Set Start to 0
- Set End to 120

Can you please fix this bug.. i strongly depend on this functionality.

Best Regards,
Stefan

Posted: Fri Jul 13, 2007 10:32 am
by Chris
Hello!

I'm sorry to say that you are right, this has got broken in the transition from teechart.net v2 to teechart.net v3 (or at least it was broken in the penultimate release as well). I'll see if I can fix it this afternoon and incorporate it into the next maintenance release. In the meantime, you can use the following workaround:

Code: Select all

		Steema.TeeChart.Styles.Line line1;
		private void InitializeChart()
		{
			tChart1.BeforeDraw += new PaintChartEventHandler(tChart1_BeforeDraw);
			tChart1.Series.Add(line1 = new Steema.TeeChart.Styles.Line());
			line1.FillSampleValues();

			tChart1.Axes.Left.PositionUnits = PositionUnits.Percent;
		}

		void tChart1_BeforeDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			Rectangle rect = tChart1.Chart.ChartRect;
			double rheight = rect.Height;
			double endPos = 120;

			double percent = endPos / rheight;
			percent *= 100;

			tChart1.Axes.Left.EndPosition = percent;
		}

Posted: Fri Jul 13, 2007 3:01 pm
by Chris
Hello,

Well, we've now added a new property, StartEndPositionUnits, which enables StartPosition and EndPosition to use different units to RelativePosition, to which the PositionUnits property now exclusively applies. The following code will therefore work ok in the next maintenance release:

Code: Select all

		Steema.TeeChart.Styles.Line line1;
		private void InitializeChart()
		{
			tChart1.Series.Add(line1 = new Steema.TeeChart.Styles.Line());
			line1.FillSampleValues();

			tChart1.Axes.Left.StartEndPositionUnits = PositionUnits.Pixels;
			tChart1.Axes.Left.StartPosition = 0;
			tChart1.Axes.Left.EndPosition = 120;

			tChart1.Axes.Left.PositionUnits = PositionUnits.Percent;
			tChart1.Axes.Left.RelativePosition = 20;
		}