Method Overview
Name | Return Type | Summary | |
---|---|---|---|
Promise | Generates a histogram for statistical purposes. more details | more details |
Method Details
histogram(params){Promise}
Generates a histogram for statistical purposes. The returned object can be used for displaying a histogram to the UI in visualization authoring applications and analytical apps that query and display statistics.
Parameters:params ObjectSee the table below for details on parameters that may be passed to this function.
Specification:layer FeatureLayer | SceneLayerThe layer for which to generate a histogram.
optionalfield StringThe name of the numeric field for which the histogram will be generated.
optionalnormalizationField StringThe field by which to normalize the values returned from the given
field
.optionalclassificationMethod StringThe method for classifying the data. See the table below for a list of possible values.
Possible Value Description natural-breaks Data values that cluster are placed into a single class. Class breaks occur where gaps exist between clusters. You should use this method if your data is unevenly distributed; that is, many features have the same or similar values and there are gaps between groups of values. equal-interval Each class has an equal range of values; in other words, the difference between the high and low value is equal for each class. You should use this method if your data is evenly distributed and you want to emphasize the difference in values between the features. quantile Each class has roughly the same number of features. If your data is evenly distributed and you want to emphasize the difference in relative position between features, you should use the quantile classification method. If, for example, the point values are divided into five classes, points in the highest class would fall into the top fifth of all points. standard-deviation Class breaks are placed above and below the mean value at intervals of 1
,0.5
, or0.25
standard deviations until all the data values are included in a class.optionalstandardDeviationInterval NumberWhen
classificationMethod = "standard-deviation"
, this sets the interval at which each class break should be set (e.g.0.25
,0.33
,0.5
,1
).optionalminValue NumberThe minimum bounding value for the histogram. Use this in conjunction with
maxValue
to generate a histogram between custom lower and upper bounds.optionalmaxValue NumberThe maximum bounding value for the histogram. Use this in conjunction with
minValue
to generate a histogram between custom lower and upper bounds.optionalnumBins NumberIndicates the number of classes to generate for the histogram.
Default Value: 10Returns:Type Description Promise Resolves to an instance of HistogramResult.
Type Definitions
HistogramResult
The result returned from the histogram() method.
Properties:bins Object[]An array of objects representing each bin in the histogram.
Specification:count NumberThe number of features that are contained between the indicated
minValue
andmaxValue
.minValue NumberThe minimum value of the bin.
maxValue NumberThe maximum value of the bin.
minValue NumberThe minimum value returned by the field.
maxValue NumberThe maximum value returned by the field.