new Bar(oGB, oOptionsopt)
Every option of the BarOptions type has associated a property of the Bar object. For instance, the option:
shape {any}, defines the shape to apply on the bar's backgroundis associated with the property:
Shape {any}, defines the shape to apply on the bar's backgroundwhich means that the following statements are equivalent:
oBar.Options = {shape: exontrol.Shapes.Button}where oBar is an object of Bar type
oBar.SetOptions({shape: exontrol.Shapes.Button})
oBar.Shape = exontrol.Shapes.Button
oBar.SetShape(exontrol.Shapes.Button)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
oGB |
Bars | Indicates an object of Bars type that's the owner collection of this bar. | |
oOptions |
object |
<optional> |
Specifies an object of BarOptions type that holds information about the bar, such as name, shape and so on. If the oOptions parameter is not-of object type it indicates the bar's name instead. |
Members
Def :ItemBarOptions
Type:
Example
null {null}, resets all default-options
{selectable: false} {object}, makes unselectable all bars of the current type
{caption: "<%=%C0%>"} {object}, all bars of the current type displays the caption of the first column
The following example shows how to set the default options of a "Task%Progress" bar of percent-type, so all item-bars of "Task%Progress" type will display their inner progress-bar's percent value using the caption format defined by percentCaptionFormat field, and the percent caption will be aligned to the left of the progress-bar:
oGantt.Chart.Bars.Add(
{
name: "Task%Progress",
shortcut: "Task",
def:
{
percent: 0,
showPercentCaption: true,
percentCaptionFormat: "<fgcolor white><sha black;2;0>%p%",
alignPercentCaption: 0
}
})
The following statements are equivalents:
oGantt.Bar("Task").SetDef({selectable: false}) {void}, makes unselectable all bars of "Task" type
oGantt.Bar("Task").Def = {selectable: false} {void}, makes unselectable all bars of "Task" type
where oGantt is an object of Chart type
Def
FormatHistogramValues :string
"value", defines the cumulative bar's effort or also called the bar's histogram value
Type:
- string
Example
"" or "value" {string}, specifies that the bar's histogram value is displayed as it is (unformatted)
"value + '%'" {string}, displays the value followed by an percent character
"value format '1'" {string}, displays the value using a single digit
"value = int(value) ? value : value format ''" {string}, displays the value without digits if integer (.00), and with two digits for any other type
FormatHistogramValues
Height :number
Type:
- number
Example
null {null}, the bar's height is 18 by default
-1 {number}, specifies that the bar's height is determined by the item's height (the item that hosts the bar defines the bar's height)
0 {number}, defines a zero-height bar (bar is hidden)
12 {number}, the bar's height is 12-pixels tall
Height
HistogramCriticalColor :string
Type:
- string
Example
"" {string}, hides the critical value
"red" {string}, shows bars that exceed the critical value in red
"rgba(255,0,0,0.5)" {string}, shows bars that exceed the critical value in partial-transparent red
HistogramCriticalColor
HistogramCriticalValue :number
Type:
- number
Example
0 {number}, any bar is critical
10 {number}, any bar that exceeds the value of 10 into histogram is critical
The following statements are equivalents:
oGantt.Bar("Task").SetHistogramCriticalValue(10), sets the critical value of "Task" bar to 10
oGantt.Bar("Task").HistogramCriticalValue = 10, sets the critical value of "Task" bar to 10
where oGantt is an object of Chart type
HistogramCriticalValue
HistogramCumulativeColors :string
To display bars in the controls histogram, the following conditions must be met:
- Each Bar must have its HistogramShape property set. By default, this property is null, so without setting it, the bar will not appear in the histogram
- The control's HistogramVisible property must be enabled to make the histogram visible
- The control's HistogramHeight property defines the vertical size of the histogram
Together, these settings ensure that the bars are correctly represented in the controls histogram.
In order to show cumulative values within the histogram, the control requires the following:
- a hierarchy must be displayed, for example by grouping items using a specific column (AllowGroupBy, SortBarVisible properties)
- the HistogramView property must include the exHistogramGroupCumulative and exHistogramNoGrouping flags
Type:
- string
Example
"" {string}, no cumulative-color is applied
"red,green,blue" {string}, the histogram shows the bars of the current type, in red, green and blue
HistogramCumulativeColors
HistogramCumulativeOriginalColorBars :Gantt.HistogramCumulativeOriginalColorBarsEnum
To display bars in the controls histogram, the following conditions must be met:
- Each Bar must have its HistogramShape property set. By default, this property is null, so without setting it, the bar will not appear in the histogram
- The control's HistogramVisible property must be enabled to make the histogram visible
- The control's HistogramHeight property defines the vertical size of the histogram
Together, these settings ensure that the bars are correctly represented in the controls histogram.
In order to show cumulative values within the histogram, the control requires the following:
- a hierarchy must be displayed, for example by grouping items using a specific column (AllowGroupBy, SortBarVisible properties)
- the HistogramView property must include the exHistogramGroupCumulative and exHistogramNoGrouping flags
The HistogramCumulativeOriginalColorBars property of exontrol.Gantt.HistogramCumulativeOriginalColorBarsEnum type supports the following values:
- exShowCumulativeColor(-1), the color for the bar is not changed, but its reflection in the histogram shows the corresponding cumulative color
- exChangeColor(0), the color for the bar and its reflection in the histogram is showing the corresponding cumulative color
- exKeepOriginalColor(1), the color for the bar and its reflection in the histogram is not changed
Type:
Example
null {null} or 0 or exontrol.Gantt.HistogramCumulativeOriginalColorBarsEnum.exChangeColor {number}, the color for the bar and its reflection in the histogram is showing the corresponding cumulative color
1 or exontrol.Gantt.HistogramCumulativeOriginalColorBarsEnum.exChangeColor {number}, the color for the bar and its reflection in the histogram is not changed
HistogramCumulativeOriginalColorBars
HistogramCumulativeShowLegend :number
To display bars in the controls histogram, the following conditions must be met:
- Each Bar must have its HistogramShape property set. By default, this property is null, so without setting it, the bar will not appear in the histogram
- The control's HistogramVisible property must be enabled to make the histogram visible
- The control's HistogramHeight property defines the vertical size of the histogram
Together, these settings ensure that the bars are correctly represented in the controls histogram.
In order to show cumulative values within the histogram, the control requires the following:
- a hierarchy must be displayed, for example by grouping items using a specific column (AllowGroupBy, SortBarVisible properties)
- the HistogramView property must include the exHistogramGroupCumulative and exHistogramNoGrouping flags
Type:
- number
Example
-1 {number}, no histogram-legend is displayed for the current type of bars
1 {number}, the column with the index 1, provides the histogram-legend for the current type of bars.
HistogramCumulativeShowLegend
HistogramGridLinesColor :string
Type:
- string
Example
"" {string}, no grid lines are shown
"gray" {string}, shows the histogram's grid lines in gray
"rgba(0,0,0,0.5)" {string}, shows the histogram's grid lines in partial-transparent black
HistogramGridLinesColor
HistogramItems :number
- negative {number}, the absolute value represents the fixed number of units being displayed on the vertical axis
- 0 {number}, the height of the units being displayed in the histogram is computed, so all units fit the histogram area
- positive {number}, indicates the number of minimum units being displayed on the vertical axis
Type:
- number
Example
0 {number}, re-scales the histogram to fit all histogram-units
10 {number}, prepares the histogram to display up to 10 items (rescales the histogram to fit all, if it requires more)
-10 {number}, the histogram always displays 10 items
HistogramItems
HistogramRulerLinesColor :string
Type:
- string
Example
"" {string}, no ruler lines are shown
"black" {string}, shows the histogram's ruler lines in black
"rgba(0,0,0,0.5)" {string}, shows the histogram's ruler lines in partial-transparent black
HistogramRulerLinesColor
HistogramShape :any
To display bars in the controls histogram, the following conditions must be met:
- Each Bar must have its HistogramShape property set. By default, this property is null, so without setting it, the bar will not appear in the histogram
- The control's HistogramVisible property must be enabled to make the histogram visible
- The control's HistogramHeight property defines the vertical size of the histogram
Together, these settings ensure that the bars are correctly represented in the controls histogram.
In order to show cumulative values within the histogram, the control requires the following:
- a hierarchy must be displayed, for example by grouping items using a specific column (AllowGroupBy, SortBarVisible properties)
- the HistogramView property must include the exHistogramGroupCumulative and exHistogramNoGrouping flags
The HistogramShape property specifies the bar's histogram shape, as one of the following:
- the shape's name within the exontrol.Shapes.Tree or exontrol.Shapes namespace
- a CSS color
- a JSON string-representation of an object of exontrol.Def.Shape type, for the column itself
- an object of {normal,hover,click,disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type
Type:
- any
Example
"" {string}, null {null}, no shape is applied (the bar is not represented into the control's histogram)
"red" {string}, shows rectangular-red histogram
'{"frameColor": "black", "primitive": "Spline"}' {string}, shows spline-curve histogram
'{"fillColor": "red"}' or '{"normal":{"fillColor": "red"}}' {string}, fills the object's background in red (JSON-representation of an object of exontrol.Def.Shape type)
"xxx" {string}, indicates that exontrol.Shapes.Gantt.xxx or exontrol.Shapes.xxx is applied on the object's background. If the xxx field is missing, no custom shape is applied (nodefault object's shape is be applied)
"Button" or exontrol.Shapes.Button {object}, applies the "Button" shape on the object as defined into exontrol.Shapes namespace (@since 5.2)
{frameColor: "blue", frameSize: 3, fillColor: "rgba(0,0,255,0.5)", primitive: "Spline"} {object}, shows filled spline-curve histogram
HistogramShape
HistogramType :Gantt.HistogramTypeEnum
- exHistOverload(0), shows the overloads and subloads of your current planning situation (the histogram-graph shows the count of specified tasks day by day, or unit by unit)
- exHistOverAllocation(1), shows in percents, the over-allocations of your current planning situation using the effort of the task divided by the length of the task (effort/length). The exHistOverAllocation flag can be combined with exHistOverAllocationFixed or exHistOverAllocationMultiply. The work-load for a task is computed as exBarEffort / length of the bar. The work-load for the task is the work effort / task duration. (i.e. If item.exBarEffort = 1 and bar's length is 10 days, then the work-load = 0.1 or 10%). The histogram- graph shows the sum of the work-loads (the work-load of each task item is added, unit by unit)
- exHistCumulative(0x100), bars in the histogram show cumulative colors (the exHistCumulative can be applied to exHistOverload and exHistOverAllocation values. For instance, the exHistOverAllocation + exHistCumulative defines a cumulative histogram for exHistOverAllocation type)
- exHistOverAllocationFixed(0x200), shows in percents, the over-allocations of your current planning situation using the effort of the task (effort) (the exHistOverAllocationFixed can be combined with the exHistOverAllocation flag only)
- exHistOverAllocationMultiply(0x400), shows in percents, the over-allocations of your current planning situation using the effort of the task multiplied by the length of the task (effort * length) (the exHistOverAllocationFixed can be combined with the exHistOverAllocation flag only)
Type:
Example
0 or exontrol.Gantt.HistogramTypeEnum.exHistOverload {Gantt.HistogramTypeEnum}, shows the overloads and subloads of your current planning situation (the histogram-graph shows the count of specified tasks day by day, or unit by unit)
257 or exontrol.Gantt.HistogramTypeEnum.exHistOverAllocation | exontrol.Gantt.HistogramTypeEnum.exHistCumulative {Gantt.HistogramTypeEnum}, shows in percents, the over-allocations of your current planning situation using the effort of the task divided by the length of the task (effort/length). Bars in the histogram show cumulative colors
HistogramType
Name :string
The A of "A%B" format can be:The B of "A%B" format can be:
- the name of already added bar, that defines the base-bar or the background-bar, such as "Task"
- the index of already added bar, that defines the base-bar or the background-bar, such as 0
- the name of already added bar, that defines the progress-bar or the foreground-bar, such as "Progress"
- the index of already added bar, that defines the progress-bar or the foreground-bar, such as 0
- the shape to show the progress-bar or the foreground-bar as
- "red" {string}, fills the progress-bar in red (CSS color)
- '{"fillColor": "red"}' or '{"normal":{"fillColor": "red"}}' {string}, fills the progress-bar in red (JSON-representation of an object of exontrol.Def.Shape type)
- "xxx" {string}, indicates that exontrol.Shapes.Gantt.xxx or exontrol.Shapes.xxx is applied on the progress-bar. If the xxx field is missing, no custom shape is applied (no default object's shape is be applied)
Type:
- string
Example
"Task" {string}, names the bar to "Task"
"Task%Progress" {string}, defines a "Task" bar of percent-type, so it displays the bar's "percent" value using the "Progress" shape
"Summary%Task" {string}, defines a "Summary" bar of percent-type, so it displays the bar's "percent" value using another "Task" shape
"Task%red" {string}, defines a "Task" bar of percent-type, so it displays the bar's "percent" value using the "red" color
"Task%Button" {string}, defines a "Task" bar of percent-type, so it displays the bar's "percent" value using the "Button" already-defined shape
'Summary%{"fillColor": "rgba(0,0,0,0.5)", "client": "[,y+2*height/3+3,,height/3]", "primitive": "round"}' {string}, defines a "Summary" bar of percent-type, so it displays the bar's "percent" value using a predefined shape
Name
Options :BarOptions
oBar.Options = {shape: exontrol.Shapes.Button}
oBar.SetOptions({shape: exontrol.Shapes.Button})
oBar.Shape = exontrol.Shapes.Button
oBar.SetShape(exontrol.Shapes.Button)
Type:
Example
The following statements are equivalents:
oBar.SetOptions({name: "Task", shape: exontrol.Shapes.Button}), changes the bar's name to "Task" and its shape to exontrol.Shapes.Button
oBar.Options = {name: "Task", shape: exontrol.Shapes.Button}, changes the bar's name to "Task" and its shape to exontrol.Shapes.Button
oBar.Name = "Task"; oBar.Shape = exontrol.Shapes.Button, changes the bar's name to "Task" and its shape to exontrol.Shapes.Button
where oBar is an object of Bar type
Options
Overlaid :object
offset {number}, specifies the vertical offset, to display the overlaid bars (it has effect for exOverlaidBarsOffset type only)
intersect {any}, specifies the shape to be shown on the portion that laid over bars (it has effect for exOverlaidBarsIntersect type only)
stack {number}, specifies the vertical-distance between two bars that covers each other (it has effect for exOverlaidBarsStack type only)
cascade {number}, specifies the vertical-distance between two bars that covers each other (it has effect for exOverlaidBarsCascade type only)
Type:
- object
Example
null {null}, specifies the default option for all overlaid types
{cascade: 4} {object}, changes the vertical-distance between two bars that covers each other, when overlaidType is exOverlaidBarsCascade
Overlaid
OverlaidGroup :string
Type:
- string
Example
"" {string} or null {null}, only bars of the same type get arranged based on the overlaidType property.
"Task,Milestone,Deadline" {string} , all these type of bars get arranged based on the overlaidType property.
OverlaidGroup
OverlaidType :Gantt.OverlaidBarsTypeEnum
- exOverlaidBarsNone(0), no overlaid bars are shown
- exOverlaidBarsOffset(1), the overlaid bars are shown using a different vertical offset. The Overlaid(exOverlaidBarsOffset) specifies the vertical offset, in pixels, to display the overlaid bars. This option does NOT change the height of the item.
- exOverlaidBarsIntersect(2), the overlaid portion is shown using a different type of bar. The Overlaid(exOverlaidBarsIntersect) specifies the name of the bar to be displayed on the portion that laid over bars. This option does NOT change the height of the item.
- exOverlaidBarsStack(3), the bars that covers each other are shown as a stack. The Overlaid(exOverlaidBarsStack) specifies the distance in pixels between two bars that covers each other. This option changes the height of the item so the bars that covers each other are displayed entirely.
- exOverlaidBarsCascade(4), the bars gets arranged as a cascade with the z-order being indicated by ItemBar(exBarOverlaidCascade) key. Arrange the bars on the same level for those with the same exBarOverlaidCascade key, and on a different level for bars with a different exBarOverlaidCascade key. This option changes the height of the item so the bars that covers each other are displayed entirely.
- exOverlaidBarsTransparent(0x100), the overlaid portion is shown using a semi-transparent color. The Overlaid(exOverlaidBarsTransparent) specifies the percent of transparency being applied to the covered bar.
- exOverlaidBarsStackAutoArrange(0x200), the overlaid stack is automatically arranged for best fit in the item. The exOverlaidBarsStackAutoArrange flag can be combined with exOverlaidBarsStack flag only.
- exOverlaidBarsIncludeCaption(0x1000), the overlaid mechanism includes the caption for bars
- exOverlaidBarsStrict(0x2000), the overlaid mechanism includes only bars in the same group ( OverlaidGroup property ) but of different types.
Type:
Example
0 {number} or null {null}, no overlaid bars are shown
4 or exontrol.Gantt.OverlaidBarsTypeEnum.exOverlaidBarsCascade {number}, the bars gets arranged as a cascade with the z-order being indicated by ItemBar(exBarOverlaidCascade) key.
OverlaidType
OverviewColor :string
Type:
- string
Example
"" {string} or null{null}, the overview color of the item-bar is defined by the item-bar's overviewColor, bar's overviewColor, item-bar's shape fill, pattern or frame color (the first truthy value in this order)
"transparent" or "rgba(0,0,0,0)" {string}, the overview representation of the bar is hidden
"red" or "#FF0000", "rgb(255,0,0)", "rgba(255,0,0,1)", ... {string}, the bar is shown in red within the control's overview
OverviewColor
Shape :any
- the shape's name within the exontrol.Shapes.Tree or exontrol.Shapes namespace
- a CSS color
- a JSON string-representation of an object of exontrol.Def.Shape type, for the column itself
- an object of {normal,hover,click,disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type
Type:
- any
Example
"" {string}, null {null}, no shape is applied
"red" {string}, fills the object's background in red (CSS color)
'{"fillColor": "red"}' or '{"normal":{"fillColor": "red"}}' {string}, fills the object's background in red (JSON-representation of an object of exontrol.Def.Shape type)
"xxx" {string}, indicates that exontrol.Shapes.Gantt.xxx or exontrol.Shapes.xxx is applied on the object's background. If the xxx field is missing, no custom shape is applied (no default object's shape is be applied)
"Button" or exontrol.Shapes.Button {object}, applies the "Button" shape on the object as defined into exontrol.Shapes namespace (@since 5.2)
Shape
Shortcut :string
Type:
- string
Example
"Task" {string}, renames the bar to "Task"
The following sample adds a "Task%Progress" bar with "Task" shortcut, so the bar can be referred by its name "Task%Progress" or by its shortcut "Task":
oGantt.Chart.Bars.Add(
{
name: "Task%Progress",
shortcut: "Task",
def:
{
percent: 0,
showPercentCaption: true,
percentCaptionFormat: "<fgcolor white><sha black;2;0>%p%",
alignPercentCaption: 0
}
})
Shortcut
ShowHistogramValues :string
"value", defines the cumulative bar's effort or also called the bar's histogram valueThe expression supports also ex-HTML formatting tags, like <bold>, <italic>, <underline>, etc.
Type:
- string
Example
"0", "" {string} or null {null}, the bar's histogram value is never shown
"1" {string}, the bar's histogram value is always shown (#1)
"'green'" {string}, the bar's histogram value is always shown in green (please pay attention to green which is quoted by ' characters)
"value > 5 ? 'red' : 0" {string}, the bar's histogram value is displayed in red only if it greater than 5
"value < 5 ? '#FF' : 'rgba(0,0,0,0.5)'" {string}, shows the bar's histogram value in blue if it less than 5, else in partial-gray
ShowHistogramValues
Methods
Remove()
Example
The following statements are equivalents:
oBar.Remove(), removes the bar itself from its collection
oGantt.Chart.Bars.Remove(oBar), removes the bar itself from its collection
where oBar is an object of Bar type
Remove