Unique value groups with headings
This sample demonstrates how to categorize unique values into groups with headings. The uniqueValueGroups property of the UniqueValueRenderer allows you to group classes of unique values into groups that can be labeled with a heading in the Legend.
The layer used in this sample visualizes areas based on their zoning designation and groups those designations into one of the following categories: Commercial, Office, Residential, Industrial, Open Space, and Other. This makes it easier to find specific codes or symbols in the legend.
The UniqueValueClass defines the label and symbol used to represent one or more unique values. Note that the values property can accept an array of values, so you can represent multiple features with similar, but different unique values, with the same symbol.