Add max y axis option and tidy up client side js.