Select to view content in your preferred language

Unique Value Renderer

3690
3
06-07-2012 12:00 PM
BrianGustafson
Occasional Contributor
Is is possible to use the unique value renderer to display null values as a symbol or all other values?
0 Kudos
3 Replies
DominiqueBroux
Esri Frequent Contributor
Is is possible to use the unique value renderer to display null values as a symbol or all other values?


You should be able to define a symbol for the null value and a default symbol for all others values with a renderer like:

<esri:UniqueValueRenderer x:Key="MyUniqueValueRenderer" Field="MyField" DefaultSymbol="{StaticResource MyDefaultSymbol}" >
    <esri:UniqueValueRenderer.Infos>
        <esri:UniqueValueInfo Value="{x:Null}" Symbol="{StaticResource MyNullSymbol}" />
    </esri:UniqueValueRenderer.Infos>
</esri:UniqueValueRenderer>


Not tested though, so sorry in advance if not working.
0 Kudos
BrianGustafson
Occasional Contributor
That works for the nulls but what about grouping the values into one symbol.  I need a way to merge these three lines into one so that they are only one row in the legend as other and not 3 rows.

<esri:UniqueValueInfo Value="{x:Null}" Label="Other" Symbol="{StaticResource OtherAccessLineSymbol}" />
<esri:UniqueValueInfo Value="1WAY" Label="Other" Symbol="{StaticResource OtherAccessLineSymbol}" />
<esri:UniqueValueInfo Value="0" Label="Other" Symbol="{StaticResource OtherAccessLineSymbol}" />
0 Kudos
DominiqueBroux
Esri Frequent Contributor
You can do it by code.
  . Wire up an Handler to the Legend Refreshed event.
  . Remove and Modify legend items in the  'LegendItems' collection for getting what you want.
0 Kudos