AnsweredAssumed Answered

Possible to combine Class Breaks Renderer with Generate Renderer?

Question asked by bcarman495 on Jan 15, 2015

I am trying to produce an application similar to the Generate Renderer sample on the ArcGIS API for JavaScript website:

Generate renderer | ArcGIS API for JavaScript

 

The problem is that I want to use it with fields that contain some text values as well, which seems to break this code.

 

However, the Class Breaks Renderer API seems to work just fine with the fields I want to use, which allows me to symbolize based on class breaks and symbology that I define for certain value ranges AND set symbology for the values that are text.

Class breaks renderer | ArcGIS API for JavaScript

 

The only problem is that the Class Breaks Renderer code does not contain a drop down menu to select a different field and re-generate the symbology for the values in the selected field.

 

Is there a way to combine these two samples so that I can select a new field from my feature service and regenerate symbology based on those values?

 

I think that what I need to do is replace the variables for "ClassBreaksDefinition" and "AlgorithmicColorRamp," within the Generate Renderer code, with the "ClassBreaksRenderer" variable from the Class Breaks Renderer code.  At the same time, I guess I also need to find a way to specify symbology (SimpleFillSymbol) for the few text values in my data that aren't defined by the class breaks and display all of this in a legend...

 

Any help would be welcomed!  Thanks for reading.

 

I've attached the code that I am working with.  Sorry the service URL is not shared to the public, I will try to fix that.

Notice that I point to fields that contain some string values with the "ClassBreaks" Sample.  The fields used for the "GenerateRenderer" sample are integer type and contain no string values, since the string type fields seemed to not work properly with that sample.

Outcomes