## Is your feature request related to a problem?

#4947 added a new query to the backend – time to convert. It works well, just one point is kind of rough: bin width and count.

## Describe the solution you'd like

Currently the number of bins is hardcoded. Ideally we should have two options:
- return a user-specified number of bins,
- otherwise infer a reasonable number of bins using some algorithm (auto option).

@alexkim205 [suggested](https://github.com/PostHog/posthog/issues/4855#issuecomment-872423877) the [Freedman-Diaconis rule](https://en.wikipedia.org/wiki/Freedman%E2%80%93Diaconis_rule) for determining bin width (and interval based on that), but unfortunately from my testing its formula would not be the most practical – it's great for keeping a pretty constant "smoothness" of the histogram esp. with normal distribution, but we face some additional constraints that make it less than ideal:
- we can't have histograms too dense visually in the UI, from my testing a practical limit is 60 bins (above that it gets too dense),
- our data generally doesn't follow much of a normal distribution.

Clamping may help though, or maybe a different formula may work better outright – I'll be testing this.

## Additional context

Issue pertaining to the experience of time to convert: #4855

#### *Thank you* for your feature request – we love each and every one!

ee/clickhouse/views/insights.py
response = self.calculate_funnel(request)
        return Response(response)
    @cached_function()
    def calculate_funnel(self, request: Request) -> Dict[str, Any]:
        team = self.team
        filter = Filter(request=request, data={"insight": INSIGHT_FUNNELS})
        if filter.funnel_viz_type == FunnelVizType.TRENDS or filter.display == TRENDS_LINEAR:
            return {"result": ClickhouseFunnelTrends(team=team, filter=filter).run()}
        elif filter.funnel_viz_type == FunnelVizType.TIME_TO_CONVERT:
            return {"result": ClickhouseFunnelTimeToConvert(team=team, filter=filter).run()}
        elif filter.funnel_order_type == FunnelOrderType.UNORDERED:
            return {"result": ClickhouseFunnelUnordered(team=team, filter=filter).run()}
        elif filter.funnel_order_type == FunnelOrderType.STRICT:
            return {"result": ClickhouseFunnelStrict(team=team, filter=filter).run()}
        else:
            return {"result": ClickhouseFunnel(team=team, filter=filter).run()}
    @cached_function()
    def calculate_retention(self, request: Request) -> Dict[str, Any]:
        team = self.team
        data = {}
        if not request.GET.get("date_from"):
            data.update({"date_from": "-11d"})
        filter = RetentionFilter(data=data, request=request)
        result = ClickhouseRetention().run(filter, team)
        return {"result": result}