Skip to content

DateBins

StructChartGuruChartGuru
public readonly struct DateBins

Date bin specification. Swift Charts equivalent: DateBins. Uses calendar units rather than raw seconds for human-friendly histogram boundaries.

public readonly DateBins.Kind Mode

Returns

ChartGuru.DateBins.Kind

public readonly int Count

Returns

System.Int32

public readonly TimeUnit Unit

Returns

ChartGuru.TimeUnit

public readonly int UnitCount

Returns

System.Int32

public readonly DateTime[] Thresholds

Returns

System.DateTime[]

public static readonly DateBins Automatic

Returns

ChartGuru.DateBins

public static DateBins ByCount(int count)

Requests an evenly distributed number of date bins, clamping the count to at least one.

Parameters

Name Type
count System.Int32

Returns

ChartGuru.DateBins

public static DateBins ByStride(TimeUnit unit, int count = 1)

Creates calendar bins at a fixed multiple of the selected time unit, clamping the multiple to at least one.

Parameters

Name Type
unit ChartGuru.TimeUnit
count System.Int32

Returns

ChartGuru.DateBins

public static DateBins ByThresholds(IEnumerable<DateTime> thresholds)

Creates date bins separated by a sorted copy of the supplied thresholds. A null sequence produces one bin.

Parameters

Name Type
thresholds System.Collections.Generic.IEnumerable{System.DateTime}

Returns

ChartGuru.DateBins

public double[] ComputeEdges(DateTime rawMin, DateTime rawMax)

Compute edges as Unix-second floats (chart-native time representation).

Parameters

Name Type
rawMin System.DateTime
rawMax System.DateTime

Returns

System.Double[]