DateTime Axis Labelling

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Paul
Newbie
Newbie
Posts: 18
Joined: Fri Jan 09, 2004 5:00 am

DateTime Axis Labelling

Post by Paul » Thu Feb 17, 2005 4:05 pm

Hi,

I have a time series chart with date and time on the x-axis (bottom). The range of data displayed (in terms of days) can vary (i.e. the charts data is parameterised). Based on the range of data displayed at any one time (which I can work out) I wish to format the axis accordingly. How can I ensure that for ranges of less than 4 days (for example) I always have a major tick at each day and 3 minor ticks depicting 6 hour shifts. I only wish the major tick to be labelled with the date in format yyyy/MM/dd. For ranges greater than 4 days I only want a major tick with a label.

I am aware of the increment property (see below) but in the help it states that its the minimum step between axis labels. How do I control the number of minor ticks between the major ones.

WebChart.Chart.Axes.Bottom.Labels.DateTimeFormat = "yyyy/MM/dd"
WebChart.Chart.Axes.Bottom.Increment = Steema.TeeChart.Utils.DateTimeStep(Steema.TeeChart.DateTimeSteps.OneDay)

Thanks,

Paul

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Feb 21, 2005 5:07 pm

Hi Paul,

you should be able to format the axes as desired in the OnBeforeDrawAxis. To know how many labels has been displayed in the axis you can use the OnGetNextAxisLabel event and also depending on the labels diplayed set the minor ticks using the MinorTickCount property.

Post Reply