Select to view content in your preferred language

Legend Title

711
1
06-04-2014 07:49 AM
JustinHunter
Regular Contributor
Is there a way to dynamically change the title of the legend? I only have one layer and I dynamically change range of colours, etc, and I want the legend title to correspond to what I'm currently measuring.
0 Kudos
1 Reply
DominiqueBroux
Esri Frequent Contributor
Not sure about what you mean exactly by 'Legend Title'.
If it's the label which is displayed close to the legend swatches, this label is coming from the renderer, for example, from the RendererInfo.Label property in case of UniqueValueRenderer or ClassBreakRenderer.

So, to change this label, the easiest way is to set the renderer with the correct labels.

For advanced scenarios, you can also change directly the LegendItemViewModel label in an handler that is wired up to the Legend.Refresh event.
0 Kudos