DateTimeFormat doesn't work on custom axes

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Brian Begy
Newbie
Newbie
Posts: 16
Joined: Fri Apr 16, 2004 4:00 am
Location: Chicago
Contact:

DateTimeFormat doesn't work on custom axes

Post by Brian Begy » Wed Jan 28, 2009 6:23 pm

X axis is date data. Y is numeric data of tank level readings.

Axis readingAxisH = new Axis(true, false, lineChart);
readingAxisH.StartPosition = 0;
readingAxisH.EndPosition = 95
readingAxisH.Labels.DateTimeFormat = "h:mtt";
readingAxisH.Labels.MultiLine = true;
readingAxisH.Labels.Angle = 60;
lineChart.Axes.Custom.Add(readingAxisH);

My bottom axis still says 1/26/2009 instead of 8:23PM and it isn't at an angle.

What gives?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jan 29, 2009 10:43 am

Hi Brian,

This is because you need to assign the custom axis to a series, for example:

Code: Select all

			Steema.TeeChart.Axis readingAxisH = new Steema.TeeChart.Axis(true, false, tChart1.Chart);
			readingAxisH.StartPosition = 0;
			readingAxisH.EndPosition = 95;
			readingAxisH.Labels.DateTimeFormat = "h:mtt";
			readingAxisH.Labels.MultiLine = true;
			readingAxisH.Labels.Angle = 60;
			tChart1.Axes.Custom.Add(readingAxisH);

			Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
			line1.XValues.DateTime = true;
			line1.FillSampleValues();
			line1.CustomHorizAxis = readingAxisH;

			tChart1.Panel.MarginBottom = 20;
Best Regards,
Narcís Calvet / 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

Post Reply