All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Series.GapWidth Property

Returns or specifies the distance between data points on the chart.

Namespace: DevExpress.Spreadsheet.Charts

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

Declaration

int GapWidth { get; set; }
Property GapWidth As Integer

Property Value

Type Description
Int32

The gap width, as a percentage. This value must be between 0 and 500.

Remarks

Use the GapWidth property to specify the space between bars or columns on the chart as a percentage of the bar or column width. You can set this property for the following charts:

  • Bar;

  • Column;

  • Box and Whisker;

  • Waterfall;

  • Histogram;

  • Pareto;

  • Funnel.

For a Pie of Pie or Bar of Pie chart, the GapWidth property specifies the space between the primary and secondary chart sections.

Example

The example below demonstrates how to create a histogram chart and specify the distance between histogram bins.

// Create a histogram chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.Histogram, worksheet["B2:B21"]);
chart.TopLeftCell = worksheet.Cells["D2"];
chart.BottomRightCell = worksheet.Cells["K18"];

// Specify histogram series options.
var options = chart.Series[0].LayoutOptions.Histogram;
options.BinType = HistogramBinType.BinWidth;
options.BinWidth = 24;
// Specify the gap width.
chart.Series[0].GapWidth = 10;

// Add the chart title.
chart.Title.Visible = true;
chart.Title.SetValue("Exam Score Distribution");
See Also