Does anybody know what algorithm Google Charts uses for their Histogram Buckets?

19 views
Skip to first unread message

Pasha S

unread,
Jun 4, 2020, 2:53:32 AM6/4/20
to Google Visualization API
I'd like to make a table to accompany my histogram but I need to know how they get their bucket sizes. They claim to use a "very well-known algorithm" to calculate bucket sizes.

Jon Orwant

unread,
Jun 4, 2020, 3:56:55 PM6/4/20
to google-visua...@googlegroups.com

On Thu, Jun 4, 2020 at 2:53 AM Pasha S <pash...@gmail.com> wrote:
I'd like to make a table to accompany my histogram but I need to know how they get their bucket sizes. They claim to use a "very well-known algorithm" to calculate bucket sizes.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/b89a135e-3643-4495-8b0a-5bce8837fef9%40googlegroups.com.

Pasha S

unread,
Jun 5, 2020, 3:08:25 PM6/5/20
to Google Visualization API
Thanks. But these rules only gives you the number of bins and bin size. it doesn't give you the limits of the bin. i believe that takes a bit more work because the google charts bins have nice starting and ending points like 5, 10, 15, 20, ....


On Thursday, June 4, 2020 at 12:56:55 PM UTC-7, Jon Orwant wrote:
On Thu, Jun 4, 2020 at 2:53 AM Pasha S <pash...@gmail.com> wrote:
I'd like to make a table to accompany my histogram but I need to know how they get their bucket sizes. They claim to use a "very well-known algorithm" to calculate bucket sizes.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.

Daniel LaLiberte

unread,
Jun 5, 2020, 3:33:42 PM6/5/20
to Google Visualization API
Hi Pasha,

With the release of Google Charts for version 46, we announced a change in how Histogram buckets were computed.  See:   https://developers.google.com/chart/interactive/docs/release_notes#october-1,-2018

Generate buckets using (the) tick generation algorithm. Default number of buckets is computed using a new histogram.numBucketsRule option. Possible values are 'sqrt', 'sturges', and 'rice'. See https://en.wikipedia.org/wiki/Histogram#Number_of_bins_and_width

So it is the tick generation algorithm that decides on the nice round numbers to use, given the approximate number of buckets to use as computed by the numBucketsRule.  We need to update the docs according to these new features.

On Fri, Jun 5, 2020 at 3:08 PM Pasha S <pash...@gmail.com> wrote:
Thanks. But these rules only gives you the number of bins and bin size. it doesn't give you the limits of the bin. i believe that takes a bit more work because the google charts bins have nice starting and ending points like 5, 10, 15, 20, ....

On Thursday, June 4, 2020 at 12:56:55 PM UTC-7, Jon Orwant wrote:
On Thu, Jun 4, 2020 at 2:53 AM Pasha S <pash...@gmail.com> wrote:
I'd like to make a table to accompany my histogram but I need to know how they get their bucket sizes. They claim to use a "very well-known algorithm" to calculate bucket sizes.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/55a6a694-24a5-44dc-8817-34f19a2c7436o%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages