sorting legend with icons