Making legend format customizable