---
title: "init(range:desiredCount:minimumStride:)"
framework: charts
role: symbol
role_heading: Initializer
path: "charts/numberbins/init(range:desiredcount:minimumstride:)-32ok2"
---

# init(range:desiredCount:minimumStride:)

Automatically determine the bins from a range of data.

## Declaration

```swift
nonisolated init(range: ClosedRange<Value>, desiredCount: Int = 10, minimumStride: Value = 0) where Value : BinaryFloatingPoint
```

## Parameters

- `range`: The range the bins should cover.
- `desiredCount`: The desired number of bins for the given data. If nil, infer the number automatically from data.
- `minimumStride`: The minimum allowed bin size.

## Return Value

Return Value The inferred bins.
