vcl-dxchartxyseriesbarview-dot-tdxchartxyseriescustombarview-3c173e55.md
Specifies bar width as a percentage of an XY diagram width allocated to display an individual bar.
property BarWidth: Single read; write;
| Type | Description |
|---|---|
| Single |
The current bar width as a percentage of the diagram width allocated to display an individual bar.
The property value ranges between 1 and 100.
|
Use the BarWidth property to change bar width. The actual bar width depends on the current diagram width and the number of bars in a group if they are grouped. The more bars in a group, the narrower an individual bar is. If you resize the Chart control and, therefore, change the diagram width, bar widths change accordingly; the distance between bars in a group remains constant.
To ensure visual consistency, only the View.BarWidth property of the first visible XY series with the active Simple Bar View affects all other visible XY series with the same active View. The View.BarWidth property values of subsequent visible Simple Bar series are ignored.
The BarWidth property affects Simple and Stacked Bar Views differently.
The Stacked Bar and Full-Stacked Bar Views stack bars on top of each other and, therefore, do not group bars side by side at argument values. In this case, the BarWidth property value specifies a portion of the distance between two tick marks on the axis of arguments.
| Value | Example[1] |
|---|---|
60 ( default ) | |
100[2] |
The Simple Bar View also does not group bars when the diagram displays only one XY series. However, in this case, the BarWidth property value specifies a portion of the distance between two tick marks on the axis of arguments minus the BarDistance property value.
| Value | Example[3] |
|---|---|
60 ( default ) | |
100[4] |
The Simple Bar View groups bars by argument values when the diagram displays multiple XY Series. In this case, the BarWidth property value specifies the quotient of the distance between two tick marks on the axis of arguments and the number of displayed XY series minus the BarDistance property value.
| Value | Example[5] |
|---|---|
60 ( default ) | |
100 |
The BarWidth property setter limits the range of assigned values between 1 and 100.
The BarWidth property’s default value is DefaultBarWidth.
Footnotes
This example demonstrates different BarWidth property values on the same diagram with three Stacked Bar series.
No distance between bars. The BarDistance property has no effect.
This example demonstrates different BarWidth property values on the same diagram with one Simple Bar series. The BarDistance property is set to 1.
The distance between bars is BarDistance.
This example demonstrates different BarWidth property values on the same diagram with three Simple Bar series. The BarDistance property is set to 1.
See Also
TdxChartXYSeriesCustomBarView.Appearance Property
TdxChartXYSeriesCustomBarView.BarDistance Property
TdxChartXYSeriesCustomBarView Class