tlupher

arcpy.MakeGraph/arcpy.Graph() not respecting template design

Discussion created by tlupher on Sep 6, 2013
Hi I'm using ArcGIS 10.2 Advanced/32-bit Python 2.7.3. I'm needing to create multiple graphs using Arcpy (4 feature classes per graph: 2 vertical line, 2 scatter plot). My code works great using a template for 2 vertical lines. However, I modified my python code and the graph template to add 2 additional xy/scatterplot series and now the template is not being followed. I know for sure my data is being input into Graph()/MakeGraph correctly.

The only thing I can think of why the template is not following my design for 4 feature classes is that I am adding series out of order (in python) in relation to how the graph series are originally ordered/read from the .tee. I would love to just manually edit a few parameters in the .tee file to fix the issue. Anyone know where to find a list of parameters for these .tee graph templates or ESRI's graph() class? I prefer not to switch to matplotlib or Grapher over this matter. Thanks for any help you may offer.

For example:

Current order of input in template.tee:

object Series3: TPointSeries
...
end
object Series4: TPointSeries
...
end
object Series1: TLineSeries
...
end
object Series2: TLineSeries
...
end

The way input is currently being input into arcpy.Graph() using python's 'zip' function:


for yr0_points, yr1_points, yr0_datums, yr1_datums in zip(yr0_points_list, yr1_points_list, yr0_datums_list, yr1_datums_list):
...
# Create the graph
graph = arcpy.Graph()

# Add a vertical bar series to the graph
graph.addSeriesLineVertical(yr0_lyr, "Elevation", "NEAR_DIST", "") #relates to object Series1: TLineSeries
graph.addSeriesLineVertical(yr1_lyr, "Elevation", "NEAR_DIST", "")  #relates to object Series2: TLineSeries
graph.addSeriesScatterPlot(yr0_datum_lyr, "Elevation","", "Descriptio") #relates to object Series3: TPointSeries
graph.addSeriesScatterPlot(yr1_datum_lyr, "Elevation","", "Descriptio") #relates to object Series4: TPointSeries
...
arcpy.MakeGraph_management(graph_grf, graph, "temp_graph")
arcpy.SaveGraph_management("temp_graph", output_graph_dir, "MAINTAIN_ASPECT_RATIO", 1209, 815)

Outcomes