

| Type | Description | |||
| ItemA as HITEM | A long expression that indicates the handle of the item that contains the bar to group to. | |||
| KeyA as Variant | A long or string expression that specifies the key of the bar to group to. The Key parameter of the AddBar method defines the key of the bar being added. | |||
| StartA as Boolean | A boolean expression that specifies whether the start or the end of the bar is grouped with other bar. True specifies that the start of the bar is grouped with other bar. False indicates that the end of the bar is grouped with other bar. | |||
| ItemB as HITEM | A long expression that indicates the handle of the item that contains the bar being grouped with. | |||
| KeyB as Variant | A long or string expression that specifies the key of the bar being grouped with. The Key parameter of the AddBar method defines the key of the bar being added. | |||
| StartB as Boolean | A boolean expression that specifies whether the start or the end of the bar is grouped with other bar. True specifies that the start of the bar is grouped with other bar. False indicates that the end of the bar is grouped with other bar. | |||
| GroupBarsOptions as Variant | Specifies one or more GroupBarsOptionsEnum values that determine how the bars are grouped. If the GroupBarsOptions is exGroupBarsNone the bars are ungrouped. For example, the exPreserveBarLength + exFlexibleInterval specifies that the bars preserves their lengths, and the bar B can be moved anywhere to the right of the bar A. | |||
| Options as Variant |
Specifies a string of numbers separated by semicolons that define the spacing between bars:
For example, "2;4" sets a fixed interval of 2 days, with a maximum of 6 days (2 + 4). |
The length of the bar and interval between two bars are defined as follows:
If using the NonworkingDays property, the ItemBar(exBarKeepWorkingCount) property indicates whether the working units of the bar is keep constant while moving/grouping. If the GroupBarsOptions parameter includes the exLimitIntervalTreatAsWorking the interval between bars is indicating the working days between days.
For instance:
If the GroupBarsOptions parameter includes the exLimitIntervalTreatAsWorking flag the options parameter are treated as working units.
Use the AddLink method to add or draw a link between two bars. Use the DefineSummaryBars method to define bars in a summary bar, so it gets updated as soon as the child bars are moved or resized. Use the UngroupBars method to ungroup two bars or all bars. The Items.ItemBar(exBarsGroup) property retrieves a collection of item,key that defines the bars begin grouped with specified bar.
The following screen shots show the changes in a group of 3 bars ( 1, 2 and 3 ), when the bar 2 ( the arrow ) is moved from Sep 26 to Sep 29, using different options for GroupBarsOptions and Options parameters. Click on the picture and view the XML file that was used to generate the picture. The Groups section stores the groups of bars. You can use the LoadXML method to load the chart from these XML files. The XML file does not load EBN files!
The following screen shot shows the chart before performing any change.

The following screen shot shows the chart after moving the bar 2, when the GroupBarsOptions and Options parameters are missing ( by default ). You can notice that the bar 1 and 3 are resized.
The following screen shot shows the chart after moving the bar 2, when the GroupBarsOptions parameter is exPreserveBarLength. You can notice that all bars are moved to preserve their lengths.
The following screen shot shows the chart after moving the bar 2, when the GroupBarsOptions parameter is exPreserveBarLength + exFlexibleInterval. All bars in the group preserves their lengths, and the bar 2 can be moved anywhere to the right of the bar 1
The following screen shot shows the chart after moving the bar 2, when the GroupBarsOptions parameter is exPreserveBarLength + exIgnoreOriginalInterval + exLimitInterval, and the Options parameter is "0;1", which means the interval between two bars may be between 0 and 1, with a starting fixed interval being 0.
By default, when grouping, the distance between the margin of the bars being grouped is kept constant. For instance, if we group the end of the bar a with the start of the bar B, the distance between end of the bar a and the start of the bar B is the same when moving or resizing any of the bars A or B.
Let's stay that we have the following chart:

with the keys:

By default ( no bars are grouped ), if we move the bar 2, from Oct 19, to Oct 21 , we get the following ( the bar 1, 3, and M are not moved or resized ):

If we group the bars as follows:
, and we move the bar 2, from Oct 19, to Oct 24 we get the following:

we notice that the bar 2 and M are moved, and bar 1 is resized.
