CChartDateTimeAxis Class Reference

A specialization of the CChartAxis class for displaying date and time data. More...

#include <ChartDateTimeAxis.h>

Inheritance diagram for CChartDateTimeAxis:

CChartAxis

List of all members.

Public Types

enum  TimeInterval {
  tiSecond, tiMinute, tiHour, tiDay,
  tiMonth, tiYear
}
 Enum listing the different base intervals.

Public Member Functions

void SetTickIncrement (bool bAuto, TimeInterval Interval, int Multiplier)
 Sets the tick increment.
void SetTickLabelFormat (bool bAutomatic, const TChartString &strFormat)
 Sets the format of the tick labels.
void SetReferenceTick (COleDateTime referenceTick)
 Sets the reference tick.


Detailed Description

A specialization of the CChartAxis class for displaying date and time data.

Member Function Documentation

void CChartDateTimeAxis::SetReferenceTick ( COleDateTime  referenceTick  ) 

Sets the reference tick.

The reference tick is a date/time which specifies a tick which should always be displayed on the axis. This is needed when the tick interval multiplier is not 1 (e.g. the interval between two ticks is 3 months). In that specific case, there is no way for the control to know which ticks should be displayed (in our example, the chart doesn't know if the first tick will be january, february or march). This is particularly annoying when the axis is panned (in that case, if we always take the first month on the axis as first tick, the ticks will always switch from one month to another). By having a refence tick, this forces the control to calculate all tick intervals based on this reference. It is set to January 1st 2000 by default.

void CChartDateTimeAxis::SetTickIncrement ( bool  bAuto,
TimeInterval  Interval,
int  Multiplier 
)

Sets the tick increment.

The tick increment is the value between two adjacents ticks on the axis. In case of a date time axis, the interval is specified by a time period because this interval might not be constant (for instance, if a tick interval of one month is specified, the distance between two adjacents ticks is not constant: it depends on the number of days in the month). The full tick interval is made of a base interval (day, month, hour, ...) and a multiplier, that is applied to this base interval. So, for an interval of three months between two ticks, you have to specify tiMonth for the interval and 3 for the multiplier.

Parameters:
bAuto Specifies if the tick increment is automatically calculated.
Interval The base interval.
Multiplier The multiplier applied to the base interval.

void CChartDateTimeAxis::SetTickLabelFormat ( bool  bAutomatic,
const TChartString &  strFormat 
)

Sets the format of the tick labels.

Parameters:
bAutomatic Specifies if the format is calculated automatically.
strFormat The format to apply to the tick label if bAutomatic is false.
Check the documentation of the COleDateTime::Format function on MSDN for more information about the format string.


The documentation for this class was generated from the following files:

Generated on Sun Jan 17 13:33:11 2010 for ChartDemo by  doxygen 1.5.8