resize the legend length