Page 1 of 1

DateTimeFormat doesn't work on custom axes

Posted: Wed Jan 28, 2009 6:23 pm
by 8125097
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?

Posted: Thu Jan 29, 2009 10:43 am
by narcis
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;