I am using ArcGIS API for Javascript in a Nuxt application and I would like to find the max and min values of a field in a feature layer hosted on ArcGIS. How to do that ?? The values for the stops for the visualVariables are hard coded and I would like them to be dynamic and take the min and max values of the field.
You can use StatisticDefinition with the query.outStatistics to get the min/max values.
You can search for "statistics" in the Sample Code page and find a number of samples including this one.
https://developers.arcgis.com/javascript/latest/sample-code/popup-customcontent/