thresholdSturges function Binning data
Returns the number of bins according to
Sturges’ formula;
the input values
must be numbers.
Implementation
int thresholdSturges(Iterable<num?> values, [num? min, num? max]) {
return math.max(1, (math.log(count(values)) / math.ln2).ceil() + 1);
}