calculating Y scale height from bars