NumberBins<T>
public readonly struct NumberBins<T> where T : struct, IConvertibleNumeric bin specification. Swift Charts equivalent: NumberBins.
Use ChartGuru.NumberBins%601.ByCount(System.Int32) for fixed bin counts, ChartGuru.NumberBins%601.ByThresholds(System.Collections.Generic.IEnumerable%7bSystem.Double%7d) for
caller-supplied edges, or ChartGuru.NumberBins%601.ByDesiredSize(System.Double%2cSystem.Boolean) for a target bin width.
Fields
Section titled “Fields”
public readonly NumberBins<T>.Kind ModeReturns
ChartGuru.NumberBins`1.Kind
public readonly int CountReturns
System.Int32
DesiredSize
Section titled “DesiredSize”public readonly double DesiredSizeReturns
System.Double
Thresholds
Section titled “Thresholds”public readonly double[] ThresholdsReturns
System.Double[]
MinimumStride
Section titled “MinimumStride”public readonly bool MinimumStrideReturns
System.Boolean
RangeMin
Section titled “RangeMin”public readonly double RangeMinReturns
System.Double
RangeMax
Section titled “RangeMax”public readonly double RangeMaxReturns
System.Double
HasExplicitRange
Section titled “HasExplicitRange”public readonly bool HasExplicitRangeReturns
System.Boolean
Automatic
Section titled “Automatic”public static readonly NumberBins<T> AutomaticReturns
ChartGuru.NumberBins`1
Methods
Section titled “Methods”
ByCount(int)
Section titled “ByCount(int)”public static NumberBins<T> ByCount(int count)Requests an evenly distributed number of numeric bins, clamping the count to at least one.
Parameters
| Name | Type |
|---|---|
count |
System.Int32 |
Returns
ChartGuru.NumberBins`1
ByThresholds(IEnumerable)
Section titled “ByThresholds(IEnumerable)”public static NumberBins<T> ByThresholds(IEnumerable<double> thresholds)Creates bins separated by a sorted copy of the supplied numeric thresholds. A null sequence produces one bin.
Parameters
| Name | Type |
|---|---|
thresholds |
System.Collections.Generic.IEnumerable{System.Double} |
Returns
ChartGuru.NumberBins`1
ByDesiredSize(double, bool)
Section titled “ByDesiredSize(double, bool)”public static NumberBins<T> ByDesiredSize(double size, bool minimumStride = false)Requests bins near the specified numeric width, optionally treating that width as a minimum stride.
Parameters
| Name | Type |
|---|---|
size |
System.Double |
minimumStride |
System.Boolean |
Returns
ChartGuru.NumberBins`1
ComputeEdges(double, double)
Section titled “ComputeEdges(double, double)”public double[] ComputeEdges(double rawMin, double rawMax)Compute concrete bin edges for the supplied raw range. Returns sorted edges
of length BinCount + 1.
Parameters
| Name | Type |
|---|---|
rawMin |
System.Double |
rawMax |
System.Double |
Returns
System.Double[]
Constructors
Section titled “Constructors”
NumberBins(IEnumerable)
Section titled “NumberBins(IEnumerable)”public NumberBins(IEnumerable<double> thresholds)Swift parity: NumberBins(thresholds:).
Parameters
| Name | Type |
|---|---|
thresholds |
System.Collections.Generic.IEnumerable{System.Double} |
NumberBins(int)
Section titled “NumberBins(int)”public NumberBins(int desiredCount)Swift parity: NumberBins(desiredCount:) (data-driven, count-based).
Parameters
| Name | Type |
|---|---|
desiredCount |
System.Int32 |
NumberBins(double, bool)
Section titled “NumberBins(double, bool)”public NumberBins(double size, bool minimumStride = false)Swift parity: NumberBins(size:) (data-driven, size-based).
Parameters
| Name | Type |
|---|---|
size |
System.Double |
minimumStride |
System.Boolean |
NumberBins(ClosedRange, double, bool)
Section titled “NumberBins(ClosedRange, double, bool)”public NumberBins(ClosedRange<double> range, double size, bool minimumStride = false)Swift parity: NumberBins(range:size:). Produces fixed bins of size
that span the supplied range, ignoring the dataset extents.
Parameters
| Name | Type |
|---|---|
range |
ChartGuru.ClosedRange{System.Double} |
size |
System.Double |
minimumStride |
System.Boolean |
NumberBins(ClosedRange, int)
Section titled “NumberBins(ClosedRange, int)”public NumberBins(ClosedRange<double> range, int desiredCount)Swift parity: NumberBins(range:desiredCount:). Uses desiredCount
equally spaced bins across the supplied range.
Parameters
| Name | Type |
|---|---|
range |
ChartGuru.ClosedRange{System.Double} |
desiredCount |
System.Int32 |