# bins

Histogram: bin rule — `square-root` (default) / `sturges` / `rice` / literal count.

Canonical: https://chart.syidax.com/docs/options/bins/

<a id="definition"></a>

## Definition

| Item | Value |
| --- | --- |
| JavaScript property | `bins` |
| HTML attribute | Pass objects, arrays, and callbacks as JavaScript properties |
| Type | `HistogramBinsRule` |
| Default | `undefined` |
| Literals in the type | `square-root`, `sturges`, `rice`, `scott`, `freedman-diaconis` |

undefined means this property was not explicitly set. The effective value may depend on the chart type and other settings.

- [HistogramBinsRule](https://chart.syidax.com/docs/types/HistogramBinsRule.md) — Type definition

<a id="example"></a>

## Configuration example

```javascript
// Register sy-histogram-chart and create the element before configuring it.
chart.bins = 6;
```

- [Histogram · Complete examples and API](https://chart.syidax.com/docs/components/histogram.md)

<a id="related"></a>

## Related documentation

A property with the same name may have different types and defaults across charts. When using a direct tag, follow that chart's documentation below.

- [Shared facade and direct tags](https://chart.syidax.com/docs/concepts.md)
- [sy-histogram-chart](https://chart.syidax.com/docs/components/histogram.md#property-bins)
