API Documentation -> NtTimeChartControl -> Init

# NtTimeChartControl.Init Method

To set up the NtTimeChartControl, you call this method. Typically this takes place in the Load( ) method of your Windows Form.

Overload List:

Modifier / Return Value | Name and Parameters | Description
--- | --- | ---
public void | Init ( int colCount, int colWidth, TimeDisplayMode timeDisplayMode ) | Initializes the NtTimeChartControl.

Return value:

None.

Parameters:

int colCount
The number of columns you want the Time Chart to have. colCount * colWidth results in the sheetWidth approximately. It is important to understand that the colCount is neither the number of columns that is visible on screen at once, nor the number of columns that makes up the full time range from year 0 to year 9999. Instead it is the number of columns the sheet will have. The sheet is the time range you can sweep over with one full move of the horizontal scroll bar from the left to the right. Please see The Data Sheet Concept for the definition of the sheet.
For example: Suppose you create a NtTimeChartControl that is 1200 pixels wide and you want one day (24 hours) to exactly fit into this visible area. Then you could set the TimeDisplayMode to TimeDisplayMode.hours and set the colWidth parameter to 50, as 24 * 50 = 1200. Then a good value for colCount would be 240 for example, because this makes your NtTimeChartControl have a horizontal scroll range which is 10 times the visible area (10 * ClientSize.Width). So you can see one full day at once while you can scroll five days to the left and five days to the right with one sweep.

int colWidth
The width of each column you want the Time Chart to have. colCount * colWidth results in the sheetWidth approximately.

TimeDisplayMode timeDisplayMode
The meaning of a column like hours, days etc. See the enum TimeDisplayMode for possible values.

Remarks:

The columns of the Time Chart do not always have exactly the same width: Imagine you set up the control to display one day per column. Then the days that contain daylight saving time switches are a little wider or more narrow than the others due to the additional or missing hour.
It is recommended to read the Initialization Concept for more explanation.

See also:

TimeDisplayMode

Top API Documentation -> NtTimeChartControl -> Init © 2016 Bassaly