Telerik Reporting R1 2017

How to: Change the Gap Between the Bars

Normally the gap is automatically calculated based on the data and chart area. If the chart area is fixed and there are many series the space between two data points may be very narrow, or very wide when fewer series. Therefore, we may need to change the gap width manually. The property that defines the amount of blank space between two adjacent data slots is the SpacingSlotCount property of the Scale class.

This property defines the ratio between the empty space per single data slot and the space that the datapoints will occupy when placed in it. The processing engine calculates how many data slots will be created on the axis, depending on the used scale and groupings. Then, using the formula Empty Space = SpacingSlotCount * DataPoint_SlotWidth (where the DataPoint_SlotWidth is the width of a single data point), the engine calculates the empty space for each slot. Half of the empty space is placed at the beginning of the slot, the other half is placed at the end and the data points are arranged in the remaining space, adjacent to each other.

The following pictures show how the column chart would look like with different values for the SpacingSlotCount property:

Category Scale Spacing Slot Count 1
Category Scale Spacing Slot Count 1a

The default value of 1 produces an empty space which size is equal to a single data point's width.

Category Scale Spacing Slot Count 0
Category Scale Spacing Slot Count 0a

When the value is set to 0, the data points will occupy all the available slot width.

Category Scale Spacing Slot Count 3
Category Scale Spacing Slot Count 3a

A higher value (in this case 3) leaves more empty space around the data points, making them thinner.

Changing the SpacingSlotCount property

To change the Scale.SpacingSlotCount property, follow these steps:

  1. On the design surface select the target axis.

  2. In the Misc section select the Scale.SpacingSlotCount property, as shown in the image below.

  3. Modify the property according to your requirements, i.e. in order to increase the empty space, increase the SpacingSlotCount value.

Graph Axis Spacing Slot Count Selected

See Also