TimeBinningProperties
汇总
TimeBinningProperties 类包含用于配置用于时间图表的时间图格的属性。
语法
TimeBinningProperties({intervalSize}, {intervalUnits}, {timeAggregationType}, {trimIncompleteInterval}, {referenceTime})
| 名称 | 说明 | 数据类型 |
|---|---|---|
|
intervalSize (可选) |
The span of time that is binned or aggregated together. This value must be used in conjunction with the |
Integer |
|
intervalUnits (可选) |
Specifies the time unit that corresponds to the
|
String |
|
timeAggregationType (可选) |
Specifies the time interval alignment type.
|
String |
|
trimIncompleteInterval (可选) |
Specifies whether incomplete time intervals at the start or end of the data span (depending on the
|
Boolean |
|
referenceTime (可选) |
The date that binning is initiated. |
DateTime |
属性
| 名称 | 说明 | 数据类型 |
|---|---|---|
|
intervalSize (读取和写入) |
将分组或聚合在一起的时间跨度。 此属性必须与 |
Integer |
|
intervalUnits (读取和写入) |
指定与
|
String |
|
referenceTime (读取和写入) |
启动分组的日期。 |
DateTime |
|
timeAggregationType (读取和写入) |
指定时间间隔对齐类型。
|
String |
|
trimIncompleteInterval (读取和写入) |
指定是否将从图表中移除(修剪)数据跨度开始或结束位置的不完整时间间隔(取决于
|
Boolean |
代码示例
可以使用 TimeBinningProperties 创建时间条形图。
import arcpy
url = r"https://services1.arcgis.com/hLJbHVT9ZrDIzK0I/arcgis/rest/services/CrimesChiTheft/FeatureServer/0"
bins = arcpy.charts.TimeBinningProperties(intervalSize=1, intervalUnits='MONTHS')
bar = arcpy.charts.Bar(x="datetime", aggregation="count", title="Incidents by Month",
timeBinningProperties=bins, dataSource=url)
bar.exportToSVG('temporal_bar.svg', width=800, height=600)