Weird histogram buckets since v44

125 views
Skip to first unread message

perspektive42

unread,
Apr 27, 2016, 1:29:53 PM4/27/16
to Google Visualization API
Since version 44 the buckets of histograms are weird. Despite using only integer values, the histogram displays broken numbers on the horizontal axis. Version 42 was still OK. See example for the same data.


Daniel LaLiberte

unread,
Apr 27, 2016, 1:58:56 PM4/27/16
to Google Visualization API
Thanks for your report.  If you could give us a link to an example, or enough of your data and options so we could reproduce it, that would help us.  

We did change how the histogram bucketing is done, and it is at least more flexible now.  Perhaps you could use the available options to constrain the number of buckets such that the tick values are more uniform.

On Wed, Apr 27, 2016 at 1:29 PM, 'perspektive42' via Google Visualization API <google-visua...@googlegroups.com> wrote:
Since version 44 the buckets of histograms are weird. Despite using only integer values, the histogram displays broken numbers on the horizontal axis. Version 42 was still OK. See example for the same data.


--
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 post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/0a637b8f-b855-42fe-abe4-31def9e249f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

perspektive42

unread,
Apr 27, 2016, 2:27:16 PM4/27/16
to Google Visualization API
I'm attaching the chart part of the source (the site is not public, yet).

I've tried changing the bucket size to 5, but still there are broken numbers. I don't have an algorithm to set a bucket size based on the data. After all, this should be done by Google Charts if I use bucketSize: 'auto'. But this then fails when there are smaller numbers, resulting in tick marks like "1.5" (which also does not make sense when there are only integer numbers in the data).
testcase.htm

Daniel LaLiberte

unread,
Apr 27, 2016, 3:11:04 PM4/27/16
to Google Visualization API
So there are definitely some problems getting nice bucket sizes.  These are surprisingly bad sometimes.  There are two soon to be documented options which will help, however, minNumBuckets and maxNumBuckets.  The default number range combined with your small bucket size are causing problems for you, but I found a workaround that you can start from:  https://jsfiddle.net/dlaliberte/4t9m0b5k/ 

On Wed, Apr 27, 2016 at 2:27 PM, 'perspektive42' via Google Visualization API <google-visua...@googlegroups.com> wrote:
I'm attaching the chart part of the source (the site is not public, yet).

I've tried changing the bucket size to 5, but still there are broken numbers. I don't have an algorithm to set a bucket size based on the data. After all, this should be done by Google Charts if I use bucketSize: 'auto'. But this then fails when there are smaller numbers, resulting in tick marks like "1.5" (which also does not make sense when there are only integer numbers in the data).

--
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 post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.

For more options, visit https://groups.google.com/d/optout.

perspektive42

unread,
Apr 27, 2016, 3:30:24 PM4/27/16
to Google Visualization API
Thanks, looking forward to the new options.

BTW, if you set the scale to logarithmic, then you get better bucket sizes, but then the number of items shown in the tooltips become weird broken numbers.

Daniel LaLiberte

unread,
Apr 27, 2016, 3:43:08 PM4/27/16
to Google Visualization API
Yes, the tooltip values are showing the log of the numbers rather than the correct number.   I thought I had fixed this, actually, but apparently not.

On Wed, Apr 27, 2016 at 3:30 PM, 'perspektive42' via Google Visualization API <google-visua...@googlegroups.com> wrote:
Thanks, looking forward to the new options.

BTW, if you set the scale to logarithmic, then you get better bucket sizes, but then the number of items shown in the tooltips become weird broken numbers.

--
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 post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages