Method Overview
Name | Return Type | Summary | Function |
---|---|---|---|
Promise<SummaryStatisticsResult> | Returns an object containing various statistics describing an age value (e.g. more details | summaryStatisticsForAge |
Method Details
-
summaryStatisticsForAge(params){Promise<SummaryStatisticsResult>}
-
Returns an object containing various statistics describing an age value (e.g. the difference between a given end time from a start time) in a Layer.
ParametersSpecificationparams ObjectSee the table below for details of each parameter.
SpecificationThe layer from which to generate age statistics for the given
startTime
andendTime
.The start time for the age calculation. This can be a field name or a date value, such as
Date.now()
. If aDate
is provided, then theendTime
parameter must be a field name.The end time for the age calculation. This can be a field name or a date value, such as
Date.now()
. If aDate
is provided, then thestartTime
parameter must be a field name.unit StringThe desired units of the age result.
Possible Values:"years"|"months"|"days"|"hours"|"minutes"|"seconds"
optional The view in which features will be rendered.
signal AbortSignaloptionalAllows for cancelable requests. If canceled, the promise will be rejected with an error named
AbortError
. See also AbortController.ReturnsType Description Promise<SummaryStatisticsResult> Returns a promise that resolves to SummaryStatisticsResult. ExamplesummaryStatisticsForAge({ layer: featureLayer, startTime: "Created_Date", endTime: Date.now(), unit: "days", view: mapView }).then(function(stats){ console.log(`Average age of open incidents in days: ${stats.avg}`); });