new Bar(oGB, oOptionsopt)
The Bar object holds information(options) about a bar within the control. The Bar(name) method gets the bar giving its index, name or reference. The Bar(name) method is equivalent with Chart.Bars.Item(name) method.
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. |
Methods
GetDef() → {object}
The GetDef() method gets the bar's default options
Returns:
Returns the bar's default options, as an object of ItemBarOptions type
- Type
- object
GetFormatHistogramValues() → {string}
The GetFormatHistogramValues() method gets the format to show bar's value in the histogram
Returns:
Returns the format to show bar's value in the histogram.
The expression supports the following keywords:
"value", defines the cumulative bar's effort or also called the bar's histogram value
- Type
- string
GetHeight() → {number}
The GetHeight() method gets the bar's height
Returns:
Returns the bar's height
- Type
- number
GetHistogramCriticalColor() → {string}
The GetHistogramCriticalColor() method gets the color to show the bars that exceed the critical value
Returns:
Returns the color to show the bars that exceed the critical value
- Type
- string
GetHistogramCriticalValue() → {number}
The GetHistogramCriticalValue() method gets the bar's critical value
Returns:
Returns the bar's critical value
- Type
- number
GetHistogramCumulativeColors() → {string}
The GetHistogramCumulativeColors() method gets the colors (separated by comma character) the histogram may show when it displays bars using cumulative type
Returns:
Returns the colors (separated by comma character) the histogram may show when it displays bars using cumulative type
- Type
- string
GetHistogramCumulativeOriginalColorBars() → {Gantt.HistogramCumulativeOriginalColorBarsEnum}
The GetHistogramCumulativeOriginalColorBars() method specifies whether the original bar's color is changed accordingly to the cumulative histogram
Returns:
Returns a value that indicates whether the original bar's color is changed accordingly to the cumulative histogram
The exontrol.Gantt.HistogramCumulativeOriginalColorBarsEnum type supports the following values:
GetHistogramCumulativeOriginalColorBars
- 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
GetHistogramCumulativeShowLegend() → {number}
The GetHistogramCumulativeShowLegend() method gets the index of the column to display the legend for the cumulative bars in the histogram
Returns:
Returns the index of the column to display the legend for the cumulative bars in the histogram
- Type
- number
GetHistogramGridLinesColor() → {string}
The GetHistogramGridLinesColor() method gets the color to show the histogram's grid lines
Returns:
Returns the color to show the histogram's grid lines
- Type
- string
GetHistogramItems() → {number}
The GetHistogramItems() method gets the number of items being represented in the histogram when overload histogram is shown
Returns:
Returns the number of items being represented in the histogram when overload histogram is shown, as explained:
- 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
GetHistogramRulerLinesColor() → {string}
The GetHistogramRulerLinesColor() method gets the color to show the histogram's ruler lines
Returns:
Returns the color to show the histogram's ruler lines
- Type
- string
GetHistogramShape() → {any}
The GetHistogramShape() method gets the bar's histogram shape
Returns:
Returns the bar's histogram shape, as one of the following:
- the shape's name within the exontrol.Shape.Tree or exontrol.Shape 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
GetHistogramType() → {Gantt.HistogramTypeEnum}
The GetHistogramType() method gets the type of the bar's histogram
Returns:
Returns the type of the bar's histogram, or how the bar's effort is represented into the control's histogram
The exontrol.Gantt.HistogramTypeEnum type supports the following values and flags:
GetHistogramType
- 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)
GetName() → {string}
The GetName() method returns the bar's name.
Returns:
Returns bar's name. If the name includes the '%' character, it defines a bar of percent-type ("A%B").
A bar of percent-type displays and handles inner progress-bar, according with the bar's "percent" option.
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.Tree.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
GetOptions() → {object}
The GetOptions() method returns the bar's options at once
Returns:
Returns an object of BarOptions type
- Type
- object
Example
The following statements are equivalents:
oBar.GetOptions(), returns the bar's options
oBar.Options, returns the bar's options
where oBar is an object of Bar type
GetOptions
GetOverlaid() → {object}
The GetOverlaid() method gets the options for the specified overlaid type, as an object of {offset, intersect, stack, cascade} type
Returns:
Returns the options for the specified overlaid type, as an object of {offset, intersect, stack, cascade} type where:
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
GetOverlaidGroup() → {string}
The GetOverlaidGroup() method gets the list of bars beside the current bar that may cover each other
Returns:
Returns the list of bars beside the current bar that may cover each other
- Type
- string
GetOverlaidType() → {Gantt.OverlaidBarsTypeEnum}
The GetOverlaidType() method gets how overlaid bars are shown
Returns:
Returns how overlaid bars are shown
The exontrol.Gantt.OverlaidBarsTypeEnum type supports the following values and flags:
GetOverlaidType
- 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.
GetOverviewColor() → {string}
The GetOverviewColor() method gets the color of the bar within the control's overview panel
Returns:
Returns the color of the bar within the control's overview panel
- Type
- string
GetShape() → {any}
The GetShape() method gets the bar's shape
Returns:
Returns the bar's shape, as one of the following:
- the shape's name within the exontrol.Shape.Tree or exontrol.Shape 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
GetShortcut() → {string}
The GetShortcut() method returns the bar's shortcut shortcut
Returns:
Returns bar's shortcut shortcut
- Type
- string
GetShowHistogramValues() → {string}
The GetShowHistogramValues() method gets the formula/expression the bar uses to display its value within the control's histogram.
Returns:
Returns the formula/expression the bar uses to display its value within the control's histogram.
The expression supports the following keywords:
"value", defines the cumulative bar's effort or also called the bar's histogram value
- Type
- string
Remove()
The Remove() method removes the bar itself from its collection.
SetDef(value)
The SetDef() method sets the bar's default options
Parameters:
Name | Type | Description |
---|---|---|
value |
object | Specifies the bar's default options, as an object of 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
SetDef
SetFormatHistogramValues(value)
The SetFormatHistogramValues() method sets the format to show bar's value in the histogram
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Specifies the format to show bar's value in the histogram
The expression supports the following keywords:
"value", defines the cumulative bar's effort or also called the bar's histogram value |
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
SetFormatHistogramValues
SetHeight(value)
The SetHeight() method sets the bar's height
Parameters:
Name | Type | Description |
---|---|---|
value |
number | Specifies the bar's height |
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
SetHeight
SetHistogramCriticalColor(value)
The SetHistogramCriticalColor() method sets the color to show the bars that exceed the critical value
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Specifies the color to show the bars that exceed the critical value |
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
SetHistogramCriticalColor
SetHistogramCriticalValue(value)
The SetHistogramCriticalValue() method sets the bar's critical value
Parameters:
Name | Type | Description |
---|---|---|
value |
number | Specifies the bar's critical value |
Example
0 {number}, any bar is critical
10 {number}, any bar that exceeds the value of 10 into histogram is critical
SetHistogramCriticalValue
SetHistogramCumulativeColors(value)
The SetHistogramCumulativeColors() method sets the colors (separated by comma character) the histogram may show when it displays bars using cumulative type
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Specifies the colors (separated by comma character) the histogram may show when it displays bars using cumulative type |
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
SetHistogramCumulativeColors
SetHistogramCumulativeOriginalColorBars(value)
The SetHistogramCumulativeOriginalColorBars() method specifies whether the original bar's color is changed accordingly to the cumulative histogram
Parameters:
Name | Type | Description |
---|---|---|
value |
Gantt.HistogramCumulativeOriginalColorBarsEnum | Specifies whether the original bar's color is changed accordingly to the cumulative histogram
The exontrol.Gantt.HistogramCumulativeOriginalColorBarsEnum type supports the following values:
|
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
SetHistogramCumulativeOriginalColorBars
SetHistogramCumulativeShowLegend(value)
The SetHistogramCumulativeShowLegend() method sets the index of the column to display the legend for the cumulative bars in the histogram
Parameters:
Name | Type | Description |
---|---|---|
value |
number | Specifies the index of the column to display the legend for the cumulative bars in the histogram |
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.
SetHistogramCumulativeShowLegend
SetHistogramGridLinesColor(value)
The SetHistogramGridLinesColor() method sets the color to show the histogram's grid lines
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Specifies the color to show the histogram's grid lines |
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
SetHistogramGridLinesColor
SetHistogramItems(value)
The SetHistogramItems() method sets the number of items being represented in the histogram when overload histogram is shown
Parameters:
Name | Type | Description |
---|---|---|
value |
number | Specifies the number of items being represented in the histogram when overload histogram is shown, as explained:
|
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
SetHistogramItems
SetHistogramRulerLinesColor(value)
The SetHistogramRulerLinesColor() method sets the color to show the histogram's ruler lines
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Specifies the color to show the histogram's ruler lines |
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
SetHistogramRulerLinesColor
SetHistogramShape(value)
The SetHistogramShape() method sets the bar's histogram shape
Parameters:
Name | Type | Description |
---|---|---|
value |
any | Specifies the bar's histogram shape, as one of the following:
|
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.Tree.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)
exontrol.Shapes.Button {object}, applies the "Button" shape on the object as defined into exontrol.Shapes namespace
{frameColor: "blue", frameSize: 3, fillColor: "rgba(0,0,255,0.5)", primitive: "Spline"} {object}, shows filled spline-curve histogram
SetHistogramShape
SetHistogramType(value)
The SetHistogramType() method sets the type of the bar's histogram
Parameters:
Name | Type | Description |
---|---|---|
value |
Gantt.HistogramTypeEnum | Specifies the type of the bar's histogram, or how the bar's effort is represented into the control's histogram
The exontrol.Gantt.HistogramTypeEnum type supports the following values and flags:
|
SetName(value)
The SetName() method changes the bar's name.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Specifies the bar's name. If the name includes the '%' character, it defines a bar of percent-type ("A%B").
A bar of percent-type displays and handles inner progress-bar, according with the bar's "percent" option.
The A of "A%B" format can be: |
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
SetName
SetOptions(oOptions)
The SetOptions() method changes the bar's options (visibility, name, ...) at once
Parameters:
Name | Type | Description |
---|---|---|
oOptions |
object | 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. |
SetOverlaid(value)
The SetOverlaid() method sets the options for the specified overlaid type, as an object of {offset, intersect, stack, cascade} type
Parameters:
Name | Type | Description |
---|---|---|
value |
object | Specifies the options for the specified overlaid type, as an object of {offset, intersect, stack, cascade} type where:
offset {number}, specifies the vertical offset, to display the overlaid bars (it has effect for exOverlaidBarsOffset type only) |
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
SetOverlaid
SetOverlaidGroup(value)
The SetOverlaidGroup() method sets the list of bars beside the current bar that may cover each other
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Specifies the list of bars beside the current bar that may cover each other |
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.
SetOverlaidGroup
SetOverlaidType(value)
The SetOverlaidType() method sets how overlaid bars are shown
Parameters:
Name | Type | Description |
---|---|---|
value |
Gantt.OverlaidBarsTypeEnum | Specifies how overlaid bars are shown
The exontrol.Gantt.OverlaidBarsTypeEnum type supports the following values and flags:
|
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.
SetOverlaidType
SetOverviewColor(value)
The SetOverviewColor() method sets the color of the bar within the control's overview panel
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Specifies the color of the bar within the control's overview panel |
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 truly 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
SetOverviewColor
SetShape(value)
The SetShape() method sets the bar's shape
Parameters:
Name | Type | Description |
---|---|---|
value |
any | Specifies the bar's shape, as one of the following:
|
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.Tree.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)
exontrol.Shapes.Button {object}, applies the "Button" shape on the object as defined into exontrol.Shapes namespace
SetShape
SetShortcut(value)
The SetShortcut() method changes the bar's shortcut shortcut
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Specifies the bar's shortcut shortcut |
Example
"Task" {string}, renames the bar to "Task"
SetShortcut
SetShowHistogramValues(value)
The SetShowHistogramValues() method sets the formula/expression the bar uses to display its value within the control's histogram
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Specifies the formula/expression the bar uses to display its value within the control's histogram
The expression supports the following keywords:
"value", defines the cumulative bar's effort or also called the bar's histogram value |
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
SetShowHistogramValues