Skip to main content
A newer version of this page is available. .

ChartView.GapWidth Property

Gets or sets the space between bar or column clusters in the Bar or Column charts, or the space between the primary and secondary charts in the Pie of Pie or Bar of Pie charts.

Namespace: DevExpress.Spreadsheet.Charts

Assembly: DevExpress.Spreadsheet.v18.2.Core.dll

Declaration

int GapWidth { get; set; }

Property Value

Type Description
Int32

An integer value that is the percentage of the gap width. This value must be between 0 and 500.

Remarks

Use the GapWidth property to control the space between each bar or column in the Bar or Column chart with one series, or the space between each group of bars or columns if the chart has multiple series.

Utilizing this property for the Pie of Pie or Bar of Pie chart changes the space between the primary and secondary charts.

The following images demonstrate how the GapWidth property works (the charts are shown in Microsoft® Excel®)

GapWidth = 20 GapWidth = 200
ColumnChartGapWidth20 ColumnChartGapWidth200.png
PieOfPieChartGapWidth20 PieOfPieChartGapWidth200

Example

The example below demonstrates how to create the clustered column chart and specify the space between each column using the ChartView.GapWidth property.

Dim worksheet As Worksheet = workbook.Worksheets("chartTask5")
workbook.Worksheets.ActiveWorksheet = worksheet

' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet("B2:C8"))
chart.TopLeftCell = worksheet.Cells("F2")
chart.BottomRightCell = worksheet.Cells("L15")

' Set the gap width between data series.
chart.Views(0).GapWidth = 33
' Hide the legend.
chart.Legend.Visible = False

The following code snippets (auto-collected from DevExpress Examples) contain references to the GapWidth property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also