JavaScript canvas histogram component