Calculate graph height after done modifying legend