NtTimeChartControl.SetTimeDisplayMode Method

The sheet of the NtTimeChartControl is devided into columns. The meaning of a column is defined by the NtTimeChartControl's time display mode which is stored in an internal variable. Possible values are defined by the enum TimeDisplayMode. These are:

Example: If the TimeDisplayMode is set to quarterday then each day is shown by four columns like shown in the NtTimeChartControl below:

Overload List:

Modifier / Return Value Name and Parameters Description

public void

SetTimeDisplayMode ( TimeDisplayMode mode )

Sets the TimeDisplayMode for use by this NtTimeChartControl using a default column width and setting the steady point to the middle of the client area.

public void

SetTimeDisplayMode ( TimeDisplayMode mode, long fixpointX )

Sets the TimeDisplayMode for use by this NtTimeChartControl using a default column width. The steady point is located at X-coordinate fixpointX.

public void

SetTimeDisplayMode ( TimeDisplayMode mode, int colWidth, long fixpointX )

Sets the TimeDisplayMode for use by this NtTimeChartControl as well as the new column width. The steady point is located at X-coordinate fixpointX.

Return value:

void

Parameters:

TimeDisplayMode mode
The TimeDisplayMode to set.

int colWidth
The new column width in pixels.

long fixpointX
When the TimeDisplayMode changes, the horizontal time axis is either beeing squeezed or stretched. For this reason objects are being moved horizontally. Only one point of time can keep its position on the screen. For example you might either want the left edge or the center of the visible area remain still. You can define this by this parameter fixpointX.

Remarks:

When using one of the overloads that do not define the new column width then the NtTimeChartControl uses the following algorithm to determine the new width:
 
If switching to the new TimeDisplayMode shrinks the time axis, it applies a big column width to keep the overall image as steady as possible.
If switching to the new TimeDisplayMode stretches the time axis, it applies a small column width also to keep the overall image as steady as possible.
 
For this reason it is good practice to omit the column width if not necessary.

See also:

TimeDisplayMode
GetTimeDisplayMode()