Skip to content
ChartForgeX
Class

ChartHistogramBinLayout

ChartForgeX.Core

Namespace
ChartForgeX.Core
Assembly
ChartForgeX
Modifiers
sealed

Defines one reusable histogram binning scheme so multiple series can share identical bounds.

Inheritance

  • object
  • ChartHistogramBinLayout

Usage

Explore 10 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 3

Methods

public static ChartHistogramBinLayout FromBoundaries(IEnumerable<double> boundaries) #

Creates adjacent bins from strictly increasing finite boundaries, preserving their unequal widths.

Parameters

boundaries System.Collections.Generic.IEnumerable<double> required
At least two boundaries, in increasing order. Inputs are copied.

Returns

ChartHistogramBinLayout An immutable reusable layout. Each bin is half open except the final inclusive upper bound.
FromCount 2 overloads
public static ChartHistogramBinLayout FromCount(double minimum, double maximum, int binCount) #

Creates the requested count of equal-width bins with boundaries aligned to a nice decimal step where possible.

Parameters

minimum double required
maximum double required
binCount int required
public static ChartHistogramBinLayout FromCount(double minimum, double maximum, int binCount, bool roundBounds) #

Creates bins with rounded, aligned bounds, or preserves exact data bounds when roundBounds is false.

Parameters

minimum double required
The lowest data value.
maximum double required
The highest data value.
binCount int required
The requested count; constant data uses one bin.
roundBounds bool required
Whether to align to multiples of a 1, 2, 2.5, 5 or 10 decimal step. A single bin crossing zero preserves the data bounds because no zero-aligned interval can cover both signs.

Returns

ChartHistogramBinLayout A reusable bin layout.
public static ChartHistogramBinLayout FromIntervals(IEnumerable<ValueTuple<double, double>> intervals) #

Creates finite, ordered, nonoverlapping bins with optional gaps between intervals.

Parameters

intervals System.Collections.Generic.IEnumerable<System.ValueTuple<double, double>> required
Positive-width intervals in increasing order. Inputs are copied; values in gaps are rejected.

Returns

ChartHistogramBinLayout An immutable reusable layout. Each interval is half open except the final inclusive upper bound.
FromWidth 2 overloads
public static ChartHistogramBinLayout FromWidth(double minimum, double maximum, double binWidth) #

Preserves the requested width and aligns all boundaries to its multiples, extending the domain to cover the data.

Parameters

minimum double required
maximum double required
binWidth double required
public static ChartHistogramBinLayout FromWidth(double minimum, double maximum, double binWidth, bool roundBounds) #

Preserves the width, using aligned equal-width bins or exact bounds with a possible final remainder bin.

Parameters

minimum double required
The lowest data value.
maximum double required
The highest data value.
binWidth double required
The caller's positive bin width.
roundBounds bool required
Whether to align bounds to multiples of the width.

Returns

ChartHistogramBinLayout A reusable bin layout.
public double GetCenter(int index) #

Gets the midpoint used for the bin's chart coordinate.

Parameters

index int required

Returns

double
public double GetLowerBound(int index) #

Gets the inclusive lower bound for a bin.

Parameters

index int required

Returns

double
public double GetUpperBound(int index) #

Gets the upper bound for a bin. The final bin includes this value.

Parameters

index int required

Returns

double
public double GetWidth(int index) #

Gets the actual width of a bin, including a shorter final bin or an authored unequal interval.

Parameters

index int required

Returns

double

Properties

public double Minimum { get; } #

Gets the inclusive minimum covered by the layout.

public double Maximum { get; } #

Gets the inclusive maximum covered by the layout.

public int Count { get; } #

Gets the number of bins.