Thanks for this Frank!
I was having trouble changing the legend label (override 1) generated by the print task for a jimu/DrawBox graphic which is being used to show the 'area of interest' in the map.
If anyone else has trouble modifying the legend for DrawBox layers, here is the code I used in the "draw-end" event of the drawBox:
var simpleJson = {
"type":"simple",
"label": "Area de Interés",
"symbol":{
"color": [
0,
112,
255,
64
],
"outline": {
"color": [
0,
0,
0,
255
],
"width": 1,
"type": "esriSLS",
"style": "esriSLSSolid"
},
"type": "esriSFS",
"style": "esriSFSSolid"
}
};
var drawboxRenderer = new SimpleRenderer(simpleJson);
this.drawBox.drawLayer.graphics[0].symbol = null;
this.drawBox.drawLayer.graphics[0]._graphicsLayer.setRenderer(drawboxRenderer);
this.drawBox.drawLayer.graphics[0]._layer.setRenderer(drawboxRenderer);
Hopefully this might be helpful for somebody,
Cheers,
Joe