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 Layer based on values returned from a given field.

Known Limitations

Only FeatureLayer, SceneLayer, and PointCloudLayer layer types are supported, except in the following scenarios:

  • FeatureLayers created with source graphics or feature collections.
  • SceneLayers without the supportsRenderer and supportsLayerQuery capabilities enabled, unless a predefined statistics object is passed to the statistics parameter of the method in conjunction with the layer. To check a SceneLayer's capabilities, use the getFieldInfoUsage() method.

Method Overview

NameReturn TypeSummaryFunction
Promise<SummaryStatisticsResult>

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

more details
more detailssummaryStatistics

Method Details

summaryStatistics(params){Promise<SummaryStatisticsResult>}

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

Parameters:
params Object

See the table below for details of each parameter.

Specification:

The layer from which to generate statistics for the given field.

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
Promise< SummaryStatisticsResult>Returns 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.