A simple JS histogram helper