I want to make a pie chart for the sizes of culverts in my county. Instead of having one slice per number, is there a way to group the numbers into two groups: >60 and <60?
I think you made need to do a new data expression to categorize your culvert size. Something like this should get you started:
var portal = Portal('https://www.arcgis.com'); var feature_layer = FeatureSetByPortalItem(portal, 'xxxxxxxxxxxxxxxxxxxxx', x, ['CulvertSize']); var Cultvert_Rankings = []; for (var f in feature_layer) { var category = When( f.CulvertSize < 60, "<60", ">60" ); var Cultvert_Ranking = { attributes: { CulvertSize: f.CulvertSize, CulvertRanking: category } }; Push(Cultvert_Rankings, Cultvert_Ranking); } var out_dict = { fields: [ { name: "CulvertSize", type: "esriFieldTypeInteger" }, { name: "CulvertRanking", type: "esriFieldTypeString" } ], geometryType: "", features: Cultvert_Rankings }; return FeatureSet(Text(out_dict));
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.