Guide
サマリー
The Guide class contains properties for configuring chart guides.
ディスカッション
When creating this object, optional arguments for the class constructor must be specified using the argument name; they cannot be specified by argument position. See the Code sample section for an example of how to specify arguments using keywords.
構文
Guide(guideType, {name}, {label}, {valueFrom}, {valueTo}, {valueFromField}, {valueFromFieldAggregationType}, {polyline}, {lineColor}, {lineWidth}, {lineDashStyle}, {fillColor})
| 名前 | 説明 | データ タイプ |
|---|---|---|
|
guideType |
Specifies the type of guide that will be created.
|
String |
|
name (オプション) |
The unique name for the guide that will appear in the Chart Properties pane. |
String |
|
label (オプション) |
The guide label that will be displayed in the chart. |
String |
|
valueFrom (オプション) |
The location of the guide when creating a line guide, or the start location of the range when creating a range guide. Use a double value for numeric axes and a |
Object |
|
valueTo (オプション) |
The end location of the range when creating a range guide. Use a double value for numeric axes and a |
Object |
|
valueFromField (オプション) |
The field name whose values will be used to calculate the location of a data-driven guide. Use this argument in conjunction with the |
String |
|
valueFromFieldAggregationType (オプション) |
Specifies the statistical calculation that will be used to determine the location of a data-driven guide. Use this argument in conjunction with the
|
String |
|
polyline (オプション) |
A list of coordinates that will be used when creating a polyline guide. Coordinates should be in row-major order. Specifying a single coordinate pair will create a point guide. Create a polyline guide.
|
List |
|
lineColor (オプション) |
The color of a line guide in hexadecimal format. |
String |
|
lineWidth (オプション) |
The width of a line guide. |
Double |
|
lineDashStyle (オプション) |
Specifies the dash style that will be used for a line guide.
|
String |
|
fillColor (オプション) |
The fill color of a range guide in hexadecimal format. |
String |
プロパティ
| 名前 | 説明 | データ タイプ |
|---|---|---|
|
fillColor (読み取り/書き込み) |
The fill color of a range guide in hexadecimal format. |
String |
|
guideType (読み取り/書き込み) |
Specifies the type of guide that will be created.
|
String |
|
label (読み取り/書き込み) |
The guide label that will be displayed in the chart. |
String |
|
lineColor (読み取り/書き込み) |
The color of a line guide in hexadecimal format. |
String |
|
lineDashStyle (読み取り/書き込み) |
Specifies the dash style that will be used for a line guide.
|
String |
|
lineWidth (読み取り/書き込み) |
The width of a line guide. |
Double |
|
name (読み取り/書き込み) |
The unique name for the guide that will appear in the Chart Properties pane. |
String |
|
polyline (読み取り/書き込み) |
A list of coordinates that will be used when creating a polyline guide. Coordinates should be in row-major order. Specifying a single coordinate pair will create a point guide. Create a polyline guide.
|
List |
|
valueFrom (読み取り/書き込み) |
The location of the guide when creating a line guide, or the start location of the range when creating a range guide. Use a double value for numeric axes and a |
Object |
|
valueFromField (読み取り/書き込み) |
The field name whose values will be used to calculate the location of a data-driven guide. Use this property in conjunction with the |
String |
|
valueFromFieldAggregationType (読み取り/書き込み) |
Specifies the statistical calculation that will be used to determine the location of a data-driven guide. Use this property in conjunction with the
|
String |
|
valueTo (読み取り/書き込み) |
The end location of the range when creating a range guide. Use a double value for numeric axes and a |
Object |
コードのサンプル
Add two guides to a scatter plot showing the average value for each axis.
import arcpy
chart = arcpy.charts.Scatter(x="voter_turnout", y="per_capita_income", dataSource="VoterTurnout2020")
# Create and configure guides
guideX = arcpy.charts.Guide(guideType="line", valueFrom=65.6, label="Avg. Voter Turnout")
guideY = arcpy.charts.Guide(guideType="line", valueFrom=26823.8, label="Avg. Per Capita Income")
# Add guides to appropriate axis
chart.xAxis.addGuide(guideX)
chart.yAxis.addGuide(guideY)
chart.exportToSVG("chart_with_guides.svg")
Add a data-driven guide to a bar chart to show the average value for the y-axis.
import arcpy
lyr = arcpy.mp.ArcGISProject("current").listMaps()[0].listLayers()[0]
chart = arcpy.charts.Bar(x="State", y="TotalPop", aggregation="MEAN")
# Create data-driven guide
guide = arcpy.charts.Guide("line", valueFromField="TotalPop", valueFromFieldAggregationType="MEAN")
# Add guide to y-axis
chart.yAxis.addGuide(guide)
chart.addToLayer(lyr)