Change ClassBreaksRenderer on runtime

1914
0
01-18-2016 10:45 AM
MohamedNabil
New Contributor

Hi,

I am working with ArcGIS Online hosted feature layer, I am trying to change the color and the max,min values of layer renderer (ClassBreaksRenderer)

The colors were changed successfully but the max and min value of the breaks didn't change, what is the problem with the code?

//Get Feature Layer
          layers = arcgisUtils.getLayerList(response);
          layer = layers[0].layer;

//Change Colors
          layer.renderer.infos[0].symbol.color.r = 255;
          layer.renderer.infos[0].symbol.color.g = 0;
          layer.renderer.infos[0].symbol.color.b = 0;

          layer.renderer.infos[1].symbol.color.r = 0;
          layer.renderer.infos[1].symbol.color.g = 0;
          layer.renderer.infos[1].symbol.color.b = 255;
//Change breaks max and min
          layer.renderer.infos[0].classMaxValue = 200;
          layer.renderer.infos[0].maxValue = 200;
          layer.renderer.infos[0].minValue = 75;       

          layer.renderer.infos[1].classMaxValue = 250;
          layer.renderer.infos[1].maxValue = 250;
          layer.renderer.infos[1].minValue = 200;
//redraw the layer
          layer.redraw();

T

0 Kudos
0 Replies