Platforms to show: All Mac Windows Linux Cross-Platform

Back to CDBarLayerMBS class.

CDBarLayerMBS.setBarGap(barGap as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the gap between the bars in a bar chart layer.

In the setBarGap method, the gap between the bars is expressed as the portion of the space between the bars. For example, a bar gap of 0.2 means 20% of the distance between two adjacent bars is the gap between the bars.

A bar gap of 0 means there is no gap in between the bars. The bar gap can be negative. In this case, the bars will overlap. The predefined constant TouchBar ( = -1.7E-100) means the bars will "touch", that is, the bar borders overlap, so two adjacent bars will share the same border.

For multi-bar layers (bar layers using the Side data combine method, or for stacked bar layers with multiple data groups), barGap refers to the portion of the space between bar groups, while subBarGap refers to the portion of the space between bars within the bar group.

ParameterDefaultDescription
barGap(Mandatory)The portion of the space between the bars (or between bar groups for multi-bar layers).
subBarGap0.2This argument only applies to multi-bar charts. It is the portion of the space between the bars in a bar group.

See also:

Some examples using this method:

CDBarLayerMBS.setBarGap(barGap as Double, subBarGap as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the gap between the bars in a bar chart layer.

In the setBarGap method, the gap between the bars is expressed as the portion of the space between the bars. For example, a bar gap of 0.2 means 20% of the distance between two adjacent bars is the gap between the bars.

A bar gap of 0 means there is no gap in between the bars. The bar gap can be negative. In this case, the bars will overlap. The predefined constant TouchBar ( = -1.7E-100) means the bars will "touch", that is, the bar borders overlap, so two adjacent bars will share the same border.

For multi-bar layers (bar layers using the Side data combine method, or for stacked bar layers with multiple data groups), barGap refers to the portion of the space between bar groups, while subBarGap refers to the portion of the space between bars within the bar group.

ParameterDefaultDescription
barGap(Mandatory)The portion of the space between the bars (or between bar groups for multi-bar layers).
subBarGap0.2This argument only applies to multi-bar charts. It is the portion of the space between the bars in a bar group.

See also:

CDBarLayerMBS.setBarShape(shape as Integer, dataGroup as Integer = -1, dataItem as Integer = -1)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the shape of the bar(s) using built-in shapes.

ParameterDefaultDescription
shape(Mandatory)The bar shape to use. Please refer to Shape Specification on how shapes are specified.
dataGroup-1The index of the data group that the shape applies to. In a multi-stacked bar, the data sets that are stacked up into a single bar forms a data group. In a multi-bar chart, each data set is a data group by itself. The default value of -1 means the shape applies to all data groups.
dataItem-1The index of the data points that the shape applies to. For example, if set to 3, the shape will only apply to the 4th bar (index starts from 0) in each data series. The default value of -1 means the shape applies to all data points.

See also:

Some examples using this method:

CDBarLayerMBS.setBarShape(shape() as Integer, dataGroup as Integer = -1, dataItem as Integer = -1)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the shape of the bar(s) to a custom shape defined using an array of (x, y) coordinates.

ParameterDefaultDescription
shape(Mandatory)The bar shape to use. Please refer to Shape Specification on how shapes are specified.
dataGroup-1The index of the data group that the shape applies to. In a multi-stacked bar, the data sets that are stacked up into a single bar forms a data group. In a multi-bar chart, each data set is a data group by itself. The default value of -1 means the shape applies to all data groups.
dataItem-1The index of the data points that the shape applies to. For example, if set to 3, the shape will only apply to the 4th bar (index starts from 0) in each data series. The default value of -1 means the shape applies to all data points.

See also:

CDBarLayerMBS.setBarWidth(barWidth as Integer, subBarWidth as Integer = -1)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the width of the bars.

ParameterDefaultDescription
barWidth(Mandatory)The width of the bars (or bar groups for multi-bar layers) in pixels.
subBarWidth-1This argument only applies to multi-bar charts. It is the width of the bars in a bar group in pixels.

Some examples using this method:

CDBarLayerMBS.setIconSize(height as Integer, width as Integer = -1)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the size of the icon(s) to be used in legend box.

By default, if a legend box is available on the chart, ChartDirector will insert an legend entry for any named data sets in the legend box. The icons for the data sets will be the shape of the bars. The size of the icons will be determined using the key size settings of the legend box (see LegendBox.setKeySize).

This method can be used to override the legend box settings to specify a custom width/height for the icons of the current BarLayer.

If the icon size is set to 0, a square color box will be used as the icon without regarding the shape of the bar.

ParameterDefaultDescription
height(Mandatory)The height of the icon in pixels.
width-1The width of the icon in pixels. The default value of -1 means the width is the same as the height.

CDBarLayerMBS.setMinImageMapSize(s as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 9.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the minimum height (or width if the x-axis and y-axis are swapped with CDXYChartMBS.swapXY) of the hot spots defined by the image map.

By default, the hot spots defined by image map exactly cover the bars. For very short bars, the hot spots may be very small, and it may become difficult to move the mouse over the hot spots.
This method ensures the hot spots are at least of certain size, even if the bars are shorter. The default is 5 pixels.

Arguments:
ArgumentDefaultDescription
size(Mandatory)The minimum height (or width if the x-axis and y-axis are swapped with CDXYChartMBS.swapXY) of the hot spots defined by the image map.

CDBarLayerMBS.setMinLabelSize(s as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the minimum height (or width for horizontal bars) of the bar segments below which data labels will be hidden.

In ChartDirector, for a bar layer, data labels (Layer.setDataLabelStyle) are drawn internal to the bar segment, while the aggregate labels (Layer.setAggregateLabelStyle) are drawn external to the bar.

ChartDirector will disable data labels for a bar segment if the bar segment is too short to contain the data label.

By default, ChartDirector will automatically determine what is meant by "too short". The setMinLabelSize method can be used to manually defined the threshold for "too short".

Sometimes it may be desirable to display the data label even though it cannot be contained within the bar segment. In this case, the setMinLabelSize can be used to set the threshold to 0.

ParameterDefaultDescription
s(Mandatory)The minimum length of the bar segments in pixels, below which data labels will be hidden.

CDBarLayerMBS.setOverlapRatio(overlapRatio as Double, firstOnTop as boolean=true)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets overlapping among bars in within a bar group in a multi-bar chart.

By default, in a multi-bar chart, the bars are not overlapped, but are separated with a gap in between. This method can be used to set an alternative style, where the bars partially overlap.

ParameterDefaultDescription
overlapRatio(Mandatory)The overlapping ratio between adjacent bars in a bar group. Should be between 0 to 1.
firstOnToptrueIf this value is true, the first data set will be on top of the second data during overlapping, and the second data set will be on top of the third data set, and so on. If this value is false, then the overlapping order will be reversed.

Some examples using this method:

CDBarLayerMBS.setRoundedCorners

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 15.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Configures rounded corners for rectangular bars.

A rectangular bar has 4 corners. Two of them are at the base of the bar, while the other two are at the "data end" of the bar. Note that the base of the bar can be any side of the bar, depending on whether the bar is positive or negative, vertical or horizontal.

For the 2 base corners, one of them is at the negative x direction while the other is at the positive x direction. The same applies to the two data end corners.

This method accepts 0, 1, 2 or 4 radius values. The usage of these values depend how many values are provided as follows.

Values ProvidedDescription
0The radii of the data end corners are automatically determined. The radii of the base corners are set to 0.
1The radii of the data end corners are set to the specified value. The radii of the base corners are set to 0.
2The radii of the data end corners are set to the first value. The radii of the base corners are set to the second value.
4The radius of the data end corner at the negative x direction is set to the first value. The radius of the data end corner at the positive x direction is set to the second value. The radius of the base corner at the negative x direction is set to the third value. The radius of the base corner at the positive x direction is set to the fourth value.

ArgumentDefaultDescription
r1-&h7fffffffThe first radius. See description above on how this radius value is used.
r2-&h7fffffffThe second radius. See description above on how this radius value is used.
r3-&h7fffffffThe third radius. See description above on how this radius value is used.
r4-&h7fffffffThe fourth radius. See description above on how this radius value is used.

See also:

CDBarLayerMBS.setRoundedCorners(r1 as Integer, r2 as Integer = -2147483647, r3 as Integer = -2147483647, r4 as Integer = -2147483647)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 15.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Configures rounded corners for rectangular bars.

A rectangular bar has 4 corners. Two of them are at the base of the bar, while the other two are at the "data end" of the bar. Note that the base of the bar can be any side of the bar, depending on whether the bar is positive or negative, vertical or horizontal.

For the 2 base corners, one of them is at the negative x direction while the other is at the positive x direction. The same applies to the two data end corners.

This method accepts 0, 1, 2 or 4 radius values. The usage of these values depend how many values are provided as follows.

Values ProvidedDescription
0The radii of the data end corners are automatically determined. The radii of the base corners are set to 0.
1The radii of the data end corners are set to the specified value. The radii of the base corners are set to 0.
2The radii of the data end corners are set to the first value. The radii of the base corners are set to the second value.
4The radius of the data end corner at the negative x direction is set to the first value. The radius of the data end corner at the positive x direction is set to the second value. The radius of the base corner at the negative x direction is set to the third value. The radius of the base corner at the positive x direction is set to the fourth value.

ArgumentDefaultDescription
r1-&h7fffffffThe first radius. See description above on how this radius value is used.
r2-&h7fffffffThe second radius. See description above on how this radius value is used.
r3-&h7fffffffThe third radius. See description above on how this radius value is used.
r4-&h7fffffffThe fourth radius. See description above on how this radius value is used.

See also:

The items on this page are in the following plugins: MBS ChartDirector Plugin.


The biggest plugin in space...