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 intervalUnits value.

Integer
intervalUnits

Specifies the time unit that corresponds to the intervalSize value.

  • SECONDSThe time unit is seconds.
  • MINUTESThe time unit is minutes.
  • HOURSThe time unit is hours.
  • DAYSThe time unit is days.
  • WEEKSThe time unit is weeks.
  • MONTHSThe time unit is months.
  • YEARSThe time unit is years.
String
timeAggregationType

Specifies the time interval alignment type.

  • equalIntervalsFromStartTimeThe time interval is aligned with the start date.
  • equalIntervalsFromEndTimeThe time interval is aligned with the end date.
  • referenceTimeThe time interval is aligned to a reference time. Used in conjunction with the referenceTime property.
String
trimIncompleteInterval

Specifies whether incomplete time intervals at the start or end of the data span (depending on the timeAggregationType value) are removed (trimmed) from the chart. Incomplete intervals on a chart can cause misleading results in which the period in question is underreported or overreported due to a different amount of time in the interval.

  • TrueIncomplete intervals are removed.
  • FalseIncomplete intervals are not removed.
Boolean
referenceTime

Specifies the time that binning is initiated.

DateTime

属性

属性说明数据类型
intervalSize
(可读写)

将分组或聚合在一起的时间跨度。 此属性必须与 intervalUnits 属性配合使用。

Integer
intervalUnits
(可读写)

指定与 intervalSize 属性值对应的时间单位。

  • SECONDS时间单位为秒。
  • MINUTES时间单位为分钟。
  • HOURS时间单位为小时。
  • DAYS时间单位为天。
  • WEEKS时间单位为周。
  • MONTHS时间单位为月。
  • YEARS时间单位为年。
String
referenceTime
(可读写)

指定启动图格化的日期。

DateTime
timeAggregationType
(可读写)

指定时间间隔对齐类型。

  • equalIntervalsFromStartTime时间间隔与开始日期对齐。
  • equalIntervalsFromEndTime时间间隔与结束日期对齐。
  • referenceTime时间间隔对齐到参考时间。 与 referenceTime 属性配合使用。
String
trimIncompleteInterval
(可读写)

指定是否将从图表中移除(修剪)数据跨度开始或结束位置的不完整时间间隔(取决于 timeAggregationType 值)。 图表中的不完整间隔会导致令人误解的结果,其中,由于间隔时间不同,时间段问题会被低估或高估。

  • True不完整间隔已移除。
  • False不完整间隔未移除。
Boolean

代码示例

TimeBinningProperties 示例

可以使用 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)