Katie, have you made any progress with this yet? It's an interesting problem.Not sure how much (or how little, as you say) experience at this point in time with arcpy -- maybe you've been experimenting since your last post? I took a cursory look at the sample provided by the MapAutomationTeam -- sometimes the best way to get started is to look at script samples.The script they provided is very short - again not sure how familiar you are right now, particularly pertaining to DDP, but the team is leveraging the 'pagerow' property get, see the webhelp at this link pertaining to DDP and see where 'pagerow' is listed:DataDrivenPages (arcpy.mapping)Desktop » Geoprocessing » ArcPy » Mapping modulehttp://resources.arcgis.com/en/help/main/10.2/index.html#//00s300000030000000Using this read-only property, you can "...return the index layer's row object for the active or current page." ---- so that 'row' obj would be returned something like this:
# your map obj, based on an input pathname:
mxd = arcpy.mapping.MapDocument(r'your mxd pathname goes here')
# fetching the row obj of your current DDP index page:
currentRow = mxd.dataDrivenPages.pageRow
...but why you'd be interested in the current index page's row object is to get at one of the field values, say if there's a field called Station_ID - then fetch that value like so (continued from the code above):
currentStation = currentRow.Station_ID
Similarly, if this makes sense from the webhelp Code section (from the webhelp link provided above; scroll to the bottom of the page), see the 2nd sample (DataDrivenPages example 2) and see where the line performing the same function to fetch a desired field value from the current index page row - it's shortened a bit by combining on a single line part of that already shown above:
# 'TSR' is the fieldname the value is fetched from in this case
fieldValue = mxd.dataDrivenPages.pageRow.TSR
...so I'm going to make a slight jump here to the MapAutomationTeam code sample, if you've downloaded that. See the section of code, called 'Modify bar chart', in the script the team provides (StandAlone_FullMapSeries.py) - it's pasted here (I added one comment to separate the 2 graphic elements being modified):
# Modify bar chart
his2000 = float(mxd.dataDrivenPages.pageRow.HisPer2000)
bar1.elementHeight = (his2000 / 50)*2
bar1txt.text = "(" + str(round(his2000, 2)) + ")"
bar1txt.elementPositionY = bar1.elementPositionY + bar1.elementHeight + 0.1
# comment I added:
# 2nd bar element modified, same line formatting as above 4 lines
his2010 = float(mxd.dataDrivenPages.pageRow.HisPer2010)
bar2.elementHeight = (his2010 / 50)*2
bar2txt.text = "(" + str(round(his2010, 2)) + ")"
bar2txt.elementPositionY = bar2.elementPositionY + bar2.elementHeight + 0.1
This code snippet uses pageRow to 'mine' the field 'HisPer2000' for every page and update, or in other words, dynamically create the bar chart for the current page...2 bars were modified based on the values found in the 2 fields, HisPer2000 and HisPer2010.That is the mechanism for controlling the graph...and that is within the looping block, if you understand that, set up by the statement:
#Loop through each DDP page
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
Make sense?...if may be a little daunting at 1st, but that's why you should probably post a small sample of your data and mxd, so you'll have a directly relevant demo you can then experiment directly with. This is actually an invaluable device for including in any reports, etc., that your org requires...and why I am interested.Hope that helps.WayneEDIT:Based on your last response, which you posted before my current (last) post...You do not need an add-in. Likely, you'd just create either a script tool or a stand-alone script --- important thing to realize here is the script is 'dynamically' updating your graph by manipulating the elements based on the current page index values. So as DDP is 'aware' of pages based on your index layer, the script 'links' the graph to those individual pages, so to speak, via 'looking up' values from the index page (the current row), modifying the graph accordingly, then exporting output...