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.

  • SECONDS—The time unit is seconds.
  • MINUTES—The time unit is minutes.
  • HOURS—The time unit is hours.
  • DAYS—The time unit is days.
  • WEEKS—The time unit is weeks.
  • MONTHS—The time unit is months.
  • YEARS—The time unit is years.
String
timeAggregationType

Specifies the time interval alignment type.

  • equalIntervalsFromStartTime—The time interval is aligned with the start date.
  • equalIntervalsFromEndTime—The time interval is aligned with the end date.
  • referenceTime—The 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.

  • True—Incomplete intervals are removed.
  • False—Incomplete 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)