Series

摘要

Series 类包含的属性用于配置组合图表中所使用的系列。 将此类与 Combo 类配合使用。

语法

 Series (y, seriesType, {aggregation})
参数说明数据类型
y

y 轴变量的字段名称。 如果指定了空字符串并将 aggregation 参数设置为 COUNT,则系列将反映每个 x 轴位置的聚合行计数。

String
seriesType

指定系列类型。

  • barThe series will be represented as bars.
  • lineThe series will be represented as a line.
String
aggregation

指定应用于聚合到每个条柱中的值的统计计算。

  • COUNTThe total number of records will be identified and applied.
  • SUMThe sum of all values will be calculated and applied.
  • MEANThe mean of all values will be calculated and applied.
  • MEDIANThe median of all values will be identified and applied.
  • MINThe minimum value will be identified and applied.
  • MAXThe maximum value will be identified and applied.
String

属性

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

指定应用于聚合到每个条柱中的值的统计计算。

  • COUNT将识别并应用总记录数。
  • SUM将计算并应用所有值的总和。
  • MEAN将计算并应用所有值的平均值。
  • MEDIAN将识别并应用所有值的中值。
  • MIN将识别并应用最小值。
  • MAX将识别并应用最大值。
String
y
(可读写)

y 轴变量的字段名称。 如果指定了空字符串并将 aggregation 属性设置为 COUNT,则系列将反映每个 x 轴位置的聚合行计数。

String
seriesType
(可读写)

指定系列类型。

  • bar该系列将以条柱表示。
  • line该系列将以线表示。
String

代码示例

系列示例

通过配置 Series 对象创建组合图表,并将图表导出至 .svg 文件。

import arcpy

seriesLeft = [arcpy.charts.Series(y="", aggregation="count", seriesType="bar")]
seriesRight = [arcpy.charts.Series(y="prcp", aggregation="mean", seriesType="line")]
chart = arcpy.charts.Combo(x="day_for_trips", seriesLeft=seriesLeft, seriesRight=seriesRight,
                           title="Bike Trips and Precipitation",                            
																											yTitleLeft="Total Rides", yTitleRight="Average Precipitation",                           
																											dataSource="BikeTripData")
chart.exportToSVG("combo.svg", width=900, height=500)