---
title: "index(for:)"
framework: charts
role: symbol
role_heading: Instance Method
path: "charts/datebins/index(for:)"
---

# index(for:)

Returns the bin index for the given value.

## Declaration

```swift
func index(for value: Date) -> Int
```

## Parameters

- `value`: The date value to get the index for.

## Return Value

Return Value The bin index.
