brownplt / code.pyret.org

Website for serving Pyret to folks.
Other
24 stars 45 forks source link

histogram function not working for all bin sizes #306

Open BootstrapJen opened 5 years ago

BootstrapJen commented 5 years ago

The histogram function only seems to work for certain bin sizes, like 1, 2, 5, 10 but doesn't work for other numbers, such as 3, 4, 6, or 7. The wrong bin size is used despite the parameter I give it.

For example, the code histogram(animals-table, "weeks", 4) gives me a graph with a bin size of 2.5.

Screen Shot 2019-04-15 at 3 43 45 PM
BootstrapJen commented 5 years ago

[https://code.pyret.org/editor#share=1ZQNHjN3Nmkz8gRPLkgveY7YMvTdOux3z&v=bf92f5e](Link to Animals dataset where I attempted histogram)

sorawee commented 5 years ago

There's nothing we can do for this one. It's a bug in Google Charts, and it's likely that the bug won't be fixed soon.

sorawee commented 5 years ago

Here's a minimal program (in the level of Google Charts) that this bug is triggered.

https://jsfiddle.net/p30nkLb1/