# new OutStatistic(options)
统计信息结构
参数:
名称 | 类型 | 默认值 | 描述 |
---|---|---|---|
options |
Object | 构造参数 |
|
statisticType |
StatisticType | 无 | 统计方法类型,必传 |
onStatisticField |
String | 无 | 要统计的字段,仅支持统计一个字段,必传 |
outStatisticFieldName |
String | 无 | 输出统计结果时,要统计的字段的别名 |
示例
//创建统计信息结构对象
let OutStatistic = new zondy.OutStatistic({
//统计最大值
statisticType: StatisticType.functionMax,
//要统计的字段
onStatisticField: 'GDP2011',
//要统计的字段的别名
outStatisticFieldName: 'anotherName'
});
成员变量
方法
# toString()
将对象转为字符串
Sting 转化后的字符串
示例
OutStatistic.toString();
//statisticType和onStatisticField存在
//字符串为:'{"statisticType": "FUNCTION_SUM","onStatisticField": "GDP2011"'
//statisticType、onStatisticField和outStatisticFieldName存在
//字符串为:'{"statisticType": "FUNCTION_SUM","onStatisticField": "GDP2011", "outStatisticFieldName":"test"}'