summaryStatistics

require(["esri/renderers/smartMapping/statistics/summaryStatistics"], function(summaryStatistics) { /* code goes here */ });
Function: esri/renderers/smartMapping/statistics/summaryStatistics
Since: ArcGIS API for JavaScript 4.2

Function for generating attribute statistics in a FeatureLayer. Statistics can be generated for values returned from a field.

Known Limitations

  • Only FeatureLayer and SceneLayer layer types are supported, except in the following scenarios:
    • FeatureLayers created with source graphics or feature collections.
    • SceneLayers without the supportsRenderer and supportsLayerQuery capabilties enabled, unless a predefined statistics object is passed to the statistics parameter of the method in conjuction with the layer. To check a SceneLayer's capabilities, use the getFieldInfoUsage() method.

Method Overview

NameReturn TypeSummary
Promise

Returns an object containing various statistics describing a set of values returned from a field in a FeatureLayer.

more details
more details

Method Details

summaryStatistics(params){Promise}

Returns an object containing various statistics describing a set of values returned from a field in a FeatureLayer.

Parameters:
params Object

See the table below for details of each parameter.

Specification:

The layer from which to query attributes for statistics.

field String
optional

The name of the numeric field for which the summary statistics will be generated.

normalizationField String
optional

The field by which to normalize the values returned from the given field.

features Graphic[]
optional

If the FeatureLayer is constructed with client-side graphics or you would like to calculate statistics based on a subset of features, then pass the features in this parameter.

minValue Number
optional

The minimum bounding value for the statistics calculation. Use this in conjunction with maxValue to generate statistics between lower and upper bounds.

maxValue Number
optional

The maximum bounding value for the statistics calculation. Use this in conjunction with minValue to generate statistics between lower and upper bounds.

Returns:
TypeDescription
PromiseReturns a promise that resolves to SummaryStatisticsResult.

Type Definitions

SummaryStatisticsResult

The statistics returned from the summaryStatistics() query.

Properties:
avg Number

The average of all values returned from the field.

count Number

The number of features evaluated.

max Number

The maximum of all values returned from the field.

min Number

The minimum of all values returned from the field.

stddev Number

The standard deviation calculated from values returned from the field.

sum Number

The sum of all values returned from the field.

variance Number

The calculated variance from all values returned from the field.

API Reference search results

NameTypeModule

There were no match results from your search criteria.