Histogram bucket size

982 views
Skip to first unread message

huneau romain

unread,
Dec 17, 2015, 5:30:32 AM12/17/15
to Google Visualization API
Hello,

I have some trouble with the histogram.bucketSize. 

histogram.bucketSize

Hardcode the size of each histogram bar, rather than letting it be determined algorithmically.

Type: number
Default: auto

I have a lot of small values, and I would like to set the bucketSize to ~0.001 but it doesn't work. Under 0.015 it seems ignore my value and I can't find any explanation in the doc. Can you tell me how to do this? 

Best regards,

Romain.

Daniel LaLiberte

unread,
Dec 17, 2015, 8:48:58 AM12/17/15
to Google Visualization API
Romain,

The Histogram tries to avoid creating too many small buckets, but it is probably imposing the limits incorrectly with very small buckets.  The options for the maximum number of buckets and the chartArea.width affect the computed bucket size, and there is an internal limit of 5 pixels per bucket, regardless what you specify.  The range of your data is also factored in, but this includes the outliers before they are excluded.  

Another misleading factor is that the ticks you see don't correspond to the bucket sizes, since it will only draw ticks that fit within the space available, so if you reduce your tick label font size, you might see more.   

However, given all that, it seems like it should be able to use smaller bucket sizes.  The 5 pixel minimum is probably too high, and we should probably allow all the way down to 1 pixel.  I am experimenting with it now, so some fixes may show up in the next release.

--
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/f3f71788-a5a7-4700-9230-360c6988750a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

huneau romain

unread,
Dec 17, 2015, 9:27:03 AM12/17/15
to Google Visualization API
Hum, Strange !? I have an resolution of 2560*1440, and the graph takes the whole length of the screen, I see 52 bars  so (1440 - (margins)) / 52 > 5 px I think. 

If I let the default value of bucket size, it can find a bucket size of 0.008. So, why is it that when I write 0,01 it doesn't work, but the algo finds 0,008 :O ? 

Romain.


Le jeudi 17 décembre 2015 14:48:58 UTC+1, Daniel LaLiberte a écrit :
Romain,

The Histogram tries to avoid creating too many small buckets, but it is probably imposing the limits incorrectly with very small buckets.  The options for the maximum number of buckets and the chartArea.width affect the computed bucket size, and there is an internal limit of 5 pixels per bucket, regardless what you specify.  The range of your data is also factored in, but this includes the outliers before they are excluded.  

Another misleading factor is that the ticks you see don't correspond to the bucket sizes, since it will only draw ticks that fit within the space available, so if you reduce your tick label font size, you might see more.   

However, given all that, it seems like it should be able to use smaller bucket sizes.  The 5 pixel minimum is probably too high, and we should probably allow all the way down to 1 pixel.  I am experimenting with it now, so some fixes may show up in the next release.
On Thu, Dec 17, 2015 at 5:30 AM, huneau romain <huneau...@gmail.com> wrote:
Hello,

I have some trouble with the histogram.bucketSize. 

histogram.bucketSize

Hardcode the size of each histogram bar, rather than letting it be determined algorithmically.

Type: number
Default: auto

I have a lot of small values, and I would like to set the bucketSize to ~0.001 but it doesn't work. Under 0.015 it seems ignore my value and I can't find any explanation in the doc. Can you tell me how to do this? 

Best regards,

Romain.

--
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.



--
Reply all
Reply to author
Forward
0 new messages