Skip to main content
All docs
V24.2

TdxChartXYSeriesCustomBarView.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 1 and 100.

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.

VCL Chart Control: Bar Distance and Bar Width

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.

VCL Chart Control: Bar Width and Multiple Series

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) VCL Chart Control: Three Stacked Bar Series and the Default Bar Width
100[2] VCL Chart Control: Three Stacked Bar Series and 100% Bar Width

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) VCL Chart Control: One Simple Bar Series and the Default Bar Width
100[4] VCL Chart Control: One Simple Bar Series and 100% Bar Width

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) VCL Chart Control: Three Simple Bar Series and the Default Bar Width
100 VCL Chart Control: Three Simple Bar Series and 100% Bar Width

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.

Footnotes
  1. This example demonstrates different BarWidth property values on the same diagram with three Stacked Bar series.

  2. No distance between bars. The BarDistance property has no effect.

  3. This example demonstrates different BarWidth property values on the same diagram with one Simple Bar series. The BarDistance property is set to 1.

  4. The distance between bars is BarDistance.

  5. 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