Bug Axis Start/End Position with Units = Pixels

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
stefans
Newbie
Newbie
Posts: 14
Joined: Mon Jul 09, 2007 12:00 am

Bug Axis Start/End Position with Units = Pixels

Post by stefans » Thu Jul 12, 2007 2:33 pm

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

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Fri Jul 13, 2007 10:32 am

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;
		}
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Fri Jul 13, 2007 3:01 pm

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;
		}
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Post Reply