categories and legend