AnsweredAssumed Answered

How to use multiple values for a single symbol in a unique value renderer?

Question asked by JQAdams on Jun 29, 2020
Latest reply on Jun 30, 2020 by JQAdams

I have a feature service I'm trying to symbolize in a web map. There are over 2,000 features in the service, but I'm using a field with a little over 200 categories for the symbology. I don't need a separate color for each of the 200 values - maybe 20 or so colors would be sufficient. Problem is, I don't want to have to create a renderer with 200 different symbologies, I would prefer to create a renderer with 20 different symbologies and use each for 10 different values. I was trying to do something like the following, but it wasn't working:

     var subdivisionRen = {
          type: "unique-value",
          field: "Book",
          defaultSymbol: { type: "simple-fill" },
          uniqueValueInfos: [{
               value: ["1853", "1863", "1873", "1883", "1893", "1903", "1913", "1923", "1933"],
               symbol: {
                    type: "simple-fill",
                    color: "blue"
               }
               }, {
               value: ["1854", "1864", "1874", "1884", "1894", "1904", "1914", "1924", "1934"],
               symbol: {
                    type: "simple-fill",
                    color: "green"
               }
               }, {
               value: ["1855", "1865", "1875", "1885", "1895", "1905", "1915", "1925", "1935"],
               symbol: {
                    type: "simple-fill",
                    color: "red"
               }
               }, {
               value: ["1856", "1866", "1876", "1886", "1896", "1906", "1916", "1926", "1936"],
               symbol: {
                    type: "simple-fill",
                    color: "yellow"
               }
          }]
     };

And so on, with 20 symbols containing 10 values each. I don't know if it's not possible to have a list for value, or if it is, if I have the syntax wrong, or what. But if anyone has any suggestions I'm all ears.

Outcomes