當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


JavaScript ArcGIS StatisticDefinition.statisticParameters用法及代碼示例


基本信息

以下是所在類或對象的基本信息。

AMD: require(["esri/rest/support/StatisticDefinition"], (StatisticDefinition) => { /* code goes here */ });

ESM: import StatisticDefinition from "@arcgis/core/rest/support/StatisticDefinition";

類: esri/rest/support/StatisticDefinition

繼承: StatisticDefinition > Accessor

自從:用於 JavaScript 4.0 的 ArcGIS API

用法說明

StatisticDefinition.statisticParameters函數(或屬性)的定義如下:

statisticParameters Object


百分位數統計參數。當 statisticType 設置為 percentile-continuouspercentile-discrete 時,必須設置此屬性。

屬性:

類型說明
value Number

百分數值。這應該是 0 到 1 之間的十進製值。

orderBy String
可選的

指定ASC(升序)或DESC(降序)來控製數據的順序。例如,在從 1 到 10 的 10 個值的數據集中,orderBy 設置為升序 (ASC) 的 0.9 的百分位值為 9,但當 orderBy 設置為降序 (DESC)結果為 2。默認值為 ASC

可能的值"ASC"|"DESC"

默認值:null

例子:

let query = layer.createQuery();
// find the median value in descending order for response_rate field
// for all features stored in the layer and order
query.outStatistics = [{
  statisticType: "percentile-continuous",
  statisticParameters: {
    value: 0.5,
    orderBy: "DESC"
  },
  onStatisticField: "response_rate",
  outStatisticFieldName: "Resp_rate_median"
}];
// query the features for the median value statistics against the values
// stored in the response_rate field
queryFeatures(query);
// Query the percentile for response time in descending order for all features in the layer
// group the percentile by Division and unit fields
let query = layer.createQuery();
query.orderByFields = ["Division, Unit"];
query.groupByFieldsForStatistics = ["Division, Unit"];
query.outStatistics = [{
  statisticType: "percentile-discrete",
  statisticParameters: {
    value: 0.67,
    orderBy: "DESC"
  },
  onStatisticField: "response_time",
  outStatisticFieldName: "response_time_percentile"
}];
queryFeatures(query);

相關用法


注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 StatisticDefinition.statisticParameters。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。