Skip to main content

TdxChartXYSeriesBarView.BarDistance Property

Specifies distance (in pixels) between bars in a bar group displayed for one argument value (category).

Declaration

property BarDistance: Integer read; write;

Property Value

Type Description
Integer

The current distance (in pixels) between bars in a bar group at 96 DPI. The property value can be 1 or higher. This property value also defines the minimum distance between bars when an XY diagram displays only one series with the active Simple Bar View.

Remarks

Use the BarDistance property to change the minimum distance between bars when the Simple Bar View is active.

The current distance between bars is subtracted from the maximum diagram area width allocated to display an individual bar. If you resize the Chart control and change the full diagram width, bar widths change accordingly; the distance between bars in a group remains constant.

VCL Chart Control: Bar Distance and Bar Width

Distance between Bars and Multiple Series

To ensure visual consistency, only the View.BarDistance 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.BarDistance property values of subsequent visible Simple Bar series are ignored.

VCL Chart Control: Bar Width and Multiple Series

Example: Distance between Bars in a Group

Value Example[1]
1 (default) VCL Chart Control: The Current Distance Between Bars is 1
5 VCL Chart Control: The Current Distance Between Bars is 5

Example: The Minimum Distance Between Bars

Value Example[2]
1 (default) VCL Chart Control: One Simple Bar Series and 100% Bar Width (the Current Distance is 1)
5 VCL Chart Control: One Simple Bar Series and 100% Bar Width (the Current Distance is 5)

Property Setter Behavior

The BarDistance property setter changes the property value to 1 if you assign a value below 1 to the BarDistance property.

Property Value and Scaling

The BarDistance property specifies the base distance between bars in a group (in pixels) that corresponds to 96 DPI. The Chart control’s draw routines multiply the BarDistance property value by the current scale factor and round the result to the nearest integer to calculate the actual distance between bars on the target screen.

Default Value

The BarDistance property’s default value is DefaultBarDistance.

Limitations

The BarDistance property affects bars only in the series that use the Simple Bar View regardless of the number of visible series. This property has no effect on series that use Stacked Bar and Full-Stacked Views.

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

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

See Also