AnsweredAssumed Answered

Changing/Removing legend headings in Javascript API 4.x?

Question asked by MollyKFoley on Mar 8, 2018
Latest reply on Mar 8, 2018 by MollyKFoley

I've got this legend:

 

I would really like to remove the "OfficialQH" heading as that is the name of the attribute field. I went back into ArcMap and cleared the heading and overwrote the service but it has not changed. Is there a way to change this? I'm not sure there is based on the unique value renderer seen on my rest services page. It appears to take that heading from the "Field 1" field and it's not like I can remove it otherwise I would have no way to symbolize the my different values.

 

I can see on my rest services page that the unique value render looks like so:

 

Renderer:Unique Value Renderer:
Field 1: 

        OfficialQH

 
Field 2: 

        null

 
Field 3: 

        null

 
Field Delimiter: 

        ,

 
Default Symbol:

          N/A

Default Label: 

        null

 
UniqueValueInfos:

      • Value: 0 
        Label: Not Quail Habitat 
        Description: 
        Symbol:Style: 
            esriSFSSolid
         
        Color: 
            [225, 225, 225, 255]
         
        Outline:Style: 
              esriSLSSolid
         
        Color: 
              [0, 0, 0, 255]
         
        Width: 
            1
      • Value: 1 
        Label: Quail Habitat 
        Description: 
        Symbol:Style: 
            esriSFSSolid
         
        Color: 
            [56, 168, 0, 255]
         
        Outline:Style: 
              esriSLSSolid
         
        Color: 
              [0, 0, 0, 255]
         
        Width: 
            1

 

 

Javascript legend code:

        //Add a legend to the view
        var legend = new Legend({
          view: view,
          layerInfos: [{
            layer: featureLayer,
            title: "Quail Habitat Status"
          }]
        });
        view.ui.add(legend, "bottom-right");


Outcomes