TdxChartXYSeriesBarView.BarWidth Property
Specifies bar width as a percentage of an XY diagram width allocated to display an individual bar.
Declaration
property BarWidth: Single read; write;
Property Value
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 |
Remarks
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.
Bar Width and Multiple Series
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.
Ungrouped Bar Width
The BarWidth
property affects Simple and Stacked Bar Views differently.
Stacked Bar Views
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] |
![]() |
Simple Bar View
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] |
![]() |
Grouped Bar Width
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 |
![]() |
Property Setter Behavior
The BarWidth
property setter limits the range of assigned values between 1
and 100
.
Default Value
The BarWidth
property’s default value is DefaultBarWidth.
-
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 to1
. -
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 to1
.