---
title: "init(data:desiredCount:minimumStride:)"
framework: charts
role: symbol
role_heading: Initializer
path: "charts/numberbins/init(data:desiredcount:minimumstride:)-3txi5"
---

# init(data:desiredCount:minimumStride:)

Automatically determine the bins from data.

## Declaration

```swift
nonisolated init(data: [Value], desiredCount: Int? = nil, minimumStride: Value = 0) where Value : BinaryFloatingPoint
```

## Parameters

- `data`: The given data values.
- `desiredCount`: The desired number of bins for the given data. If nil, infer the number of bins automatically from data using https://doi.org/10.1093/biomet/66.3.605 capped at 200.
- `minimumStride`: The minimum allowed bin size.

## Return Value

Return Value The inferred bins.
