ChartHistogramBinLayout
ChartForgeX.Core
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.
Returned or exposed by 7
- Property ChartHistogramBin.Layout
- Method ChartHistogramBinLayout.FromBoundaries
- Method ChartHistogramBinLayout.FromCount
- Method ChartHistogramBinLayout.FromIntervals
- Method ChartHistogramBinLayout.FromWidth
- Property ChartSeries.HistogramBinLayout
- Property ChartDataBin<T>.Layout
Accepted by parameters 3
- Method Chart.AddHistogram
- Method ChartSeries.CreateHistogram
- Method ChartDataset<T>.Bin
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>
- 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.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
- maximum double
- binCount int
Returns
ChartHistogramBinLayoutpublic 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
- The lowest data value.
- maximum double
- The highest data value.
- binCount int
- The requested count; constant data uses one bin.
- roundBounds bool
- 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.
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>>
- 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.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
- maximum double
- binWidth double
Returns
ChartHistogramBinLayoutpublic 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
- The lowest data value.
- maximum double
- The highest data value.
- binWidth double
- The caller's positive bin width.
- roundBounds bool
- Whether to align bounds to multiples of the width.
public double GetCenter(int index) #Gets the midpoint used for the bin's chart coordinate.
Parameters
- index int
Returns
doublepublic double GetLowerBound(int index) #Gets the inclusive lower bound for a bin.
Parameters
- index int
Returns
doublepublic double GetUpperBound(int index) #Gets the upper bound for a bin. The final bin includes this value.
Parameters
- index int
Returns
doublepublic double GetWidth(int index) #Gets the actual width of a bin, including a shorter final bin or an authored unequal interval.
Parameters
- index int
Returns
double