hide legend if series length is greater than 5, only show legend attributes