Back to Devexpress

HistogramSeriesOptions Interface

officefileapi-devexpress-dot-spreadsheet-dot-charts-9463a075.md

latest5.0 KB
Original Source

HistogramSeriesOptions Interface

Contains options for histogram and Pareto series.

Namespace : DevExpress.Spreadsheet.Charts

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
public interface HistogramSeriesOptions
vb
Public Interface HistogramSeriesOptions

The following members return HistogramSeriesOptions objects:

Remarks

Use the HistogramSeriesOptions object’s properties to specify bin options for histogram and Pareto charts.

PropertyDescription
HistogramSeriesOptions.BinTypeSpecifies how to calculate bins for a histogram.
HistogramSeriesOptions.BinCountDefines the number of histogram bins.
HistogramSeriesOptions.BinWidthDefines the bin size.
HistogramSeriesOptions.OverflowType,
HistogramSeriesOptions.OverflowValueAllow you to create a bin for all values that are above a specific value.
HistogramSeriesOptions.UnderflowType,
HistogramSeriesOptions.UnderflowValueAllow you to create a bin for all values that are below or equal to a specific value.
HistogramSeriesOptions.IntervalClosedSideSpecifies the bin closed side.

Create a Histogram Chart

csharp
// 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");
vb
' Create a histogram chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.Histogram, worksheet("B2:B21"))
chart.TopLeftCell = worksheet.Cells("D2")
chart.BottomRightCell = worksheet.Cells("K18")

' Specify histogram series options.
Dim options As HistogramSeriesOptions = 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")

Create a Pareto Chart

csharp
// Create a Pareto chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.Pareto, worksheet["B2:C7"]);
chart.TopLeftCell = worksheet.Cells["E2"];
chart.BottomRightCell = worksheet.Cells["L17"];

// Specify series options.
var options = chart.Series[0].LayoutOptions.Histogram;
options.BinType = HistogramBinType.ByCategory;
// Specify the gap width.
chart.Series[0].GapWidth = 15;

// Add the chart title.
chart.Title.Visible = true;
chart.Title.SetValue("Key Causes of Late Projects");
vb
' Create a Pareto chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.Pareto, worksheet("B2:C7"))
chart.TopLeftCell = worksheet.Cells("E2")
chart.BottomRightCell = worksheet.Cells("L17")

' Specify series options.
Dim options As HistogramSeriesOptions = chart.Series(0).LayoutOptions.Histogram
options.BinType = HistogramBinType.ByCategory
' Specify the gap width.
chart.Series(0).GapWidth = 15

' Add the chart title.
chart.Title.Visible = True
chart.Title.SetValue("Key Causes of Late Projects")

See Also

HistogramSeriesOptions Members

DevExpress.Spreadsheet.Charts Namespace