Page 1 of 1

DateTime Axis Labelling

Posted: Thu Feb 17, 2005 4:05 pm
by 8123414
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

Posted: Mon Feb 21, 2005 5:07 pm
by Pep
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.