Histogram bin size not working well

Not sure if a bug or some edge case with data.
How do make more bins?
Now I get max 3 and I’d like to have let’s say 10.
Thanks.

See :
https://ibb.co/1QGGdTs
https://ibb.co/cx0mHFs

codepad.org/2TToZWhN
Hours,Count,Average of Hours
0.500000,3,0.500000
1.000000,8,1.000000
1.500000,2,1.500000
1.716666,1,1.716666
1.833333,2,1.833333
2.000000,2,2.000000
2.166666,1,2.166666
2.500000,1,2.500000
2.550000,1,2.550000
3.000000,3,3.000000
3.166666,1,3.166666
3.250000,1,3.250000
3.500000,3,3.500000
3.516666,1,3.516666
3.750000,1,3.750000
3.966666,1,3.966666
4.000000,2,4.000000
4.166666,1,4.166666
[…]

Hi @mariusz
Which version of Metabase? Please post "Diagnostic Info" from Admin > Troubleshooting.
Which database type are you querying?
I can get it to show 10 bins on my test machine:

Its version v0.34.1. built on 2020-01-13.
When I set 100 bins I have 3 buckets of data. What is the definition of bins here? 100 means 100 equal data ranges? What do you have when you set auto-bins?

@mariusz
If I remember the binning magic correctly, it will guesstimate what sort of binning it can do based on the analysis (scanning) of the field.

When I tell it to bin 100, then I get 28 bins of the 68 rows in your dataset, since I think it looks at the values as integers - or perhaps guesstimates the decimal placement, and in this case it decided on zero decimals.

I cannot auto-bin, since it doesn’t have any information about the field, since it’s a static SQL query (I just did a quick hack to try to reproduce your problem), but that seems like a bug. Just gives me the error Input to resolve-default-strategy does not match schema: e[0;33m [(named {:special_type missing-required-key} metadata) nil nil] e[0m

I’m going to ping @sbelak, since he knows a lot more about binning, so I’ll hope he can enlighten us with what could be causing this and if there indeed are issues.

100 bins should mean exactly that … and it certainly shouldn’t error. Mind opening an issue (it might be more than one issue at play here, but let’s get there step by step).

For reference:
https://github.com/metabase/metabase/issues/12004 - upvote by clicking :+1: on the first post