new GV(oGantt)
The GV class defines the chart's view, which displays the tasks of the chart, according with the chart's time-scale. By default, the control includes the oGV member that defines the default view of the control, as an object of GV type. The control can include multiple views, which can be created by AddGanttView() method. Each view can have its own time-scale and header levels, but all views share the same chart's items and selection. The view supports different methods to scroll its content and ensure that a giving client or the chart's selection fits the view's client area. The view also supports methods to get or set the first and last visible dates of the view.
Parameters:
| Name | Type | Description |
|---|---|---|
oGantt |
Gantt | Specifies an object of Gantt type that defines the owner control of the view to create. |
Members
FirstVisibleDate :number|string|Date
The FirstVisibleDate property gets or sets the view's first visible date. The LastVisibleDate property gets the view's last visible date. The StartPrintDate property gets the minimum-date for the entire chart (lower date) as undefined (the chart includes no bars) or the minimum-date for the entire chart (lower date). The EndPrintDate property gets the maximum-date for the entire chart (upper date), as undefined (the chart includes no bars) or the maximum-date for the entire chart (upper date).
The FirstVisibleDate property can be one of the following types:
- value {string}, defines the date in string-format as "#MM/DD/YYYY[ HH:mm:ss]#"
- value {Date}, indicates a JavaScript date to be copied
- value {number} integer value representing the year of the date to be created
- value {null} or {undefined}, indicates the current date and time (equivalent of Now)
Type:
- number | string | Date
Example
The following statements are equivalents:
oGantt.oGV.SetFirstVisibleDate("#12/31/1971#"), sets the view's first visible date
oGantt.oGV.FirstVisibleDate = "#12/31/1971#", sets the view's first visible date
where oGantt is an object of Gantt type
FirstVisibleDate
(readonly) LastVisibleDate :Date
The LastVisibleDate property gets the view's last visible date. The FirstVisibleDate property gets or sets the view's first visible date. The StartPrintDate property gets the minimum-date for the entire chart (lower date) as undefined (the chart includes no bars) or the minimum-date for the entire chart (lower date). The EndPrintDate property gets the maximum-date for the entire chart (upper date), as undefined (the chart includes no bars) or the maximum-date for the entire chart (upper date).
Type:
- Date
Example
The following statements are equivalents:
oGantt.oGV.GetLastVisibleDate(), gets the view's last visible date
oGantt.oGV.LastVisibleDate, gets the view's last visible date
where oGantt is an object of Gantt type
LastVisibleDate
Methods
EnsureVisibleClient(clientA, ensureOptsopt)
The EnsureVisibleClient() method ensures that the giving object/client fits the control's client area. The client can be any of the following: item-bar, item or an absolute-coordinates of a layout-rectangle. The EnsureVisibleSelection() method scrolls the control's content to ensure that the control's selection fits the control's client area. The ScrollPos property scrolls horizontally and/or vertically the control's default view. The Chart.ScrollTo() method scrolls the chart to ensure that specified date fits the chart's area. The Zoom() method zooms the view so the start-end interval fits the client's area. The EnsureVisibleClient() method applies only to the chart section, whereas Gantt.EnsureVisibleClient() applies to both the items section and the chart section.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
clientA |
object | The client parameter could be any of the following:
|
|||||||||||||||||||||||||||||||
ensureOpts |
object |
<optional> |
Specifies different options to run the current method, as an object of {force, allowScale, allowScroll, nearestFit, duration, thisArg, cbkR, cbkI, cbkT}
Properties
|
Example
oGantt.oGV.EnsureVisibleClient( oItemBar ); // ensures that the item-bar fits the view's client area, by scrolling the view if required
oGantt.oGV.EnsureVisibleClient( oItem ); // ensures that the item fits the view's client area, by scrolling the view if required
oGantt.oGV.EnsureVisibleClient( {s: startDate, e: endDate} ); // ensures that the date range between startDate and endDate fits the view's client area, by scrolling and/or zooming the view if required
where oGantt is the control's object of Gantt type, oGV is the control's gantt-view as an object of GV type, oItemBar is an object of ItemBar type that belongs to the control, oItem is an object of exontrol.Tree.Item type that belongs to the control, and startDate/endDate are Date objects.
EnsureVisibleClient
EnsureVisibleSelection(ensureOpts)
The EnsureVisibleSelection() method scrolls the control's content to ensure that the view's selection fits the control's client area. The EnsureVisibleClient() method ensures that the giving object/client fits the view's client area. The ScrollPos property scrolls horizontally and/or vertically the control's default view. The Chart.ScrollTo() method scrolls the chart to ensure that specified date fits the chart's area. The EnsureVisibleSelection() method applies only to the chart section, whereas Gantt.EnsureVisibleSelection() applies to both the items section and the chart section. The Zoom() method zooms the view so the start-end interval fits the client's area.
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ensureOpts |
object | Specifies different options to run the current method, as an object of {expandParents, selection, duration} type.
Properties
|
Example
oGantt.oGV.EnsureVisibleSelection({expandParents: 1}); // expands the parent-items of the selected item-bars and scrolls the chart to ensure that the current chart's selection fits the chart's visible area.
EnsureVisibleSelection
Zoom(start, end, changeUnitWidthopt)
The Zoom() method zooms the view so the start-end interval fits the client's area. The EnsureVisibleClient() method ensures that the giving object/client fits the control's client area. The client can be any of the following: item-bar, item or an absolute-coordinates of a layout-rectangle. The EnsureVisibleSelection() method scrolls the control's content to ensure that the control's selection fits the control's client area. The ScrollPos property scrolls horizontally and/or vertically the control's default view. The Chart.ScrollTo() method scrolls the chart to ensure that specified date fits the chart's area.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
start |
number | string | Date | A value of one of the following types:
|
|
end |
number | string | Date | A value of one of the following types:
|
|
changeUnitWidth |
boolean |
<optional> |
Specifies whether the chart's unit-width is changed (defaults to true). |
- Since:
- 1.6
Example
oGantt.oGV.Zoom("#12/31/1971#", "#12/31/2024#"), zooms the view to fit the interval between December 31, 1971 and December 31, 2024
Zoom