<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Create multiple graphs from large geodatabase table in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143033#M11138</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I think I should include an example of the data that I am using to better explain what I am trying to accomplish&lt;BR /&gt;&lt;BR /&gt;Attached: Example.xlsx&lt;BR /&gt;&lt;BR /&gt;This is also in a File Geodatabase as a Geodatabase Table&lt;BR /&gt;This table is composed of around 9500 meter records (METER NUMBER)&lt;BR /&gt;&lt;BR /&gt;1) Go through the table and find METER NUMBER record with the billing period, KWH and KW Demand rows attached.&lt;BR /&gt;&lt;BR /&gt;2) Extract/export/select a unique METER NUMBER with the data attached (billing period, KWH and KW Demand)&lt;BR /&gt;&lt;BR /&gt;3) Take the data and build a graph showing the Billing Period along the "X" Axis, KWH and KW Demand along the "Y" Axis&lt;BR /&gt;&lt;BR /&gt;4) Export the graph to a .PDF with the METER NUMBER as the file name&lt;BR /&gt;&lt;BR /&gt;From there I can use the Attachments Geoprocessing tool to take the .PDF and attach it to the Meter Location in the .MXD&lt;BR /&gt;&lt;BR /&gt;Long Term Goal is to create a One-Touch custom Button to select a specific METER NUMBER to create a graph described above and automatically create a .PDF. &lt;BR /&gt;&lt;BR /&gt;I know this sounds like a huge project - and want to learn how to build it piece by piece to eventually accomplish the Long Term Goal.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help in advanced&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Excellent! It is great that you have written out a plan, many people don't and then get hopelessly lost... It definitely looks possible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Right now we'll get step 1 partly working, just printing to screen. Once that is good we can put the data in a useful data structure, rather than just printing it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think James' suggestion, of using Pandas, is good. I haven't used it myself, but I think it works pretty well with time data and plotting functions. So there is something else you will need to look up and have a play with...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you intend to only ever assess one meter at a time? You have a few options, but for now we may as well keep part 1 collecting all the data, and between part 1 and part 2 define the one METER NUMBER to make the graph of.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Aug 2013 21:08:45 GMT</pubDate>
    <dc:creator>StacyRendall1</dc:creator>
    <dc:date>2013-08-27T21:08:45Z</dc:date>
    <item>
      <title>Create multiple graphs from large geodatabase table</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143025#M11130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have a rather large project I am trying to do and I hope I can get Python to do it for me. I have a file geodatabase table called "SERVICE METERS DEMAND" which is basically composed of the peak demand reading on an electric meter for a given month. I have the range of readings from November 2011 to March 2013. The table contains about 172,000 total records with almost 10,000 electric meters. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; What I want to be able to do is to take an individual meter by number (TWACs Number) and create a graph visually showing the peak demand for each month. This would be used by our engineering department and our meter techs for analysis and decisions making. The big thing is - I update this table about 4 times a year so my geodatabase can have the latest demand readings that other departments use. With that being said, I would like to create a script that can automatically create all new graphs and export them out to a .PDF format. I can than use the Attachment geoprocessing tools to link those .PDF graphs to the meter locations.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do you think this is something that can be done by Python? If so - how do I start this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I currently have ArcMap 10.0 on one machine and in the process of testing a bunch of different tools/processes on ArcMap 10.2 on a different machine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can send a sample of the SERVICE METERS DEMAND table as well&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 13:56:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143025#M11130</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2013-08-23T13:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple graphs from large geodatabase table</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143026#M11131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This can definitely be done in Python, but you will have to learn a lot!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here are a few bits to get you started:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v00000039000000"&gt;SearchCursor (10.0)&lt;/A&gt;, &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//018w00000011000000"&gt;da.SearchCursor (10.2)&lt;/A&gt; allows you to iterate through tables and get values. You could store the values (date, reading) within lists in a Python dictionary by meter number.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Python &lt;A href="http://docs.python.org/2/library/datetime.html"&gt;datetime &lt;/A&gt;module (inbuilt) will be helpful for working with dates.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://matplotlib.org/"&gt;Matplotlib&lt;/A&gt; allows you to plot things from Python.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know how to make PDFs from Python, but I have no doubt whatsoever that it is possible...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would suggest you start playing around with matplotlib, datetime and searchcursors first, once you are familiar with them, start to think about the data structure that you will use to get the information from the searchcursor, analyse the monthly peak, and pass the result to matplotlib. Happy to help if you have more specific queries!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Aug 2013 22:32:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143026#M11131</guid>
      <dc:creator>StacyRendall1</dc:creator>
      <dc:date>2013-08-25T22:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple graphs from large geodatabase table</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143027#M11132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;matplotlib is definitely a good option.&amp;nbsp; We also incorporate pandas data frames to help shape and group data and date ranges.&amp;nbsp; As a final step, Attachements are enabled and populated in a File Geodatabase.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lots of possibilities and learning to do!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 11:12:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143027#M11132</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2013-08-26T11:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple graphs from large geodatabase table</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143028#M11133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Stacy-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Thank you for the ideas. I have playing around with the SearchCursor in Python and so far all I am getting it to do is to "Print" to the screen. What else would I have to do to extract this data out?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;This can definitely be done in Python, but you will have to learn a lot!&lt;BR /&gt;&lt;BR /&gt;Here are a few bits to get you started:&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v00000039000000"&gt;SearchCursor (10.0)&lt;/A&gt;, &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//018w00000011000000"&gt;da.SearchCursor (10.2)&lt;/A&gt; allows you to iterate through tables and get values. You could store the values (date, reading) within lists in a Python dictionary by meter number.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Python &lt;A href="http://docs.python.org/2/library/datetime.html"&gt;datetime &lt;/A&gt;module (inbuilt) will be helpful for working with dates.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://matplotlib.org/"&gt;Matplotlib&lt;/A&gt; allows you to plot things from Python.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;I don't know how to make PDFs from Python, but I have no doubt whatsoever that it is possible...&lt;BR /&gt;&lt;BR /&gt;I would suggest you start playing around with matplotlib, datetime and searchcursors first, once you are familiar with them, start to think about the data structure that you will use to get the information from the searchcursor, analyse the monthly peak, and pass the result to matplotlib. Happy to help if you have more specific queries!&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 13:57:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143028#M11133</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2013-08-27T13:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple graphs from large geodatabase table</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143029#M11134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Stacy-&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Thank you for the ideas. I have playing around with the SearchCursor in Python and so far all I am getting it to do is to "Print" to the screen. What else would I have to do to extract this data out?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would get my Search Cursor into a pandas data frame and use that to group and plot as needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

FeatClassArray = []
fc = r"H:\Documents\ArcGIS\Default.gdb\MyFeatureClass"
fields = [f.name for f in arcpy.ListFields(fc)]&amp;nbsp;&amp;nbsp; 

with arcpy.da.SearchCursor(fc, fields) as cursor:
&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FeatClassArray.append(row)

df = DataFrame(FeatClassArray)

#now use the df with matplotlib functionality to build your plots/graphs
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143029#M11134</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-11T07:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple graphs from large geodatabase table</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143030#M11135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Having a hard time getting multiple fields to show up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have about (4) fields that I need to show:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TWACs_NUMBER&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PERIOD_ENDS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KWH_USAGE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KW_DEMAND&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So Far - I can get the "TWACs_NUMBER to "print" to the screen - but I need all of these fields to "print" so I can sort them by TWACs NUMBER&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 14:43:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143030#M11135</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2013-08-27T14:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple graphs from large geodatabase table</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143031#M11136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think I should include an example of the data that I am using to better explain what I am trying to accomplish&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached: Example.xlsx&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is also in a File Geodatabase as a Geodatabase Table&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This table is composed of around 9500 meter records (METER NUMBER)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Go through the table and find METER NUMBER record with the billing period, KWH and KW Demand rows attached.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Extract/export/select a unique METER NUMBER with the data attached (billing period, KWH and KW Demand)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Take the data and build a graph showing the Billing Period along the "X" Axis, KWH and KW Demand along the "Y" Axis&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4) Export the graph to a .PDF with the METER NUMBER as the file name&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From there I can use the Attachments Geoprocessing tool to take the .PDF and attach it to the Meter Location in the .MXD&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Long Term Goal is to create a One-Touch custom Button to select a specific METER NUMBER to create a graph described above and automatically create a .PDF. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know this sounds like a huge project - and want to learn how to build it piece by piece to eventually accomplish the Long Term Goal.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help in advanced&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 15:18:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143031#M11136</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2013-08-27T15:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple graphs from large geodatabase table</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143032#M11137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Having a hard time getting multiple fields to show up.&lt;BR /&gt;&lt;BR /&gt;I have about (4) fields that I need to show:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TWACs_NUMBER&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PERIOD_ENDS&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KWH_USAGE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KW_DEMAND&lt;BR /&gt;&lt;BR /&gt;So Far - I can get the "TWACs_NUMBER to "print" to the screen - but I need all of these fields to "print" so I can sort them by TWACs NUMBER&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A few questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;Please include your code so far.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;What Arc version are you using?&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Have you read and played with the examples included in the docs, which I attached in the last post?&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;SPAN&gt;To include code, simply copy it from your editor or the Python window in ArcMap/Catalog (if that is what you are using) then paste it in your reply. To preserve indentation and identify it as code, select all the code and click the &lt;/SPAN&gt;&lt;STRONG&gt;#&lt;/STRONG&gt;&lt;SPAN&gt; button on the forum writing tools at the top of the edit box.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 20:57:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143032#M11137</guid>
      <dc:creator>StacyRendall1</dc:creator>
      <dc:date>2013-08-27T20:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple graphs from large geodatabase table</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143033#M11138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I think I should include an example of the data that I am using to better explain what I am trying to accomplish&lt;BR /&gt;&lt;BR /&gt;Attached: Example.xlsx&lt;BR /&gt;&lt;BR /&gt;This is also in a File Geodatabase as a Geodatabase Table&lt;BR /&gt;This table is composed of around 9500 meter records (METER NUMBER)&lt;BR /&gt;&lt;BR /&gt;1) Go through the table and find METER NUMBER record with the billing period, KWH and KW Demand rows attached.&lt;BR /&gt;&lt;BR /&gt;2) Extract/export/select a unique METER NUMBER with the data attached (billing period, KWH and KW Demand)&lt;BR /&gt;&lt;BR /&gt;3) Take the data and build a graph showing the Billing Period along the "X" Axis, KWH and KW Demand along the "Y" Axis&lt;BR /&gt;&lt;BR /&gt;4) Export the graph to a .PDF with the METER NUMBER as the file name&lt;BR /&gt;&lt;BR /&gt;From there I can use the Attachments Geoprocessing tool to take the .PDF and attach it to the Meter Location in the .MXD&lt;BR /&gt;&lt;BR /&gt;Long Term Goal is to create a One-Touch custom Button to select a specific METER NUMBER to create a graph described above and automatically create a .PDF. &lt;BR /&gt;&lt;BR /&gt;I know this sounds like a huge project - and want to learn how to build it piece by piece to eventually accomplish the Long Term Goal.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help in advanced&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Excellent! It is great that you have written out a plan, many people don't and then get hopelessly lost... It definitely looks possible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Right now we'll get step 1 partly working, just printing to screen. Once that is good we can put the data in a useful data structure, rather than just printing it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think James' suggestion, of using Pandas, is good. I haven't used it myself, but I think it works pretty well with time data and plotting functions. So there is something else you will need to look up and have a play with...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you intend to only ever assess one meter at a time? You have a few options, but for now we may as well keep part 1 collecting all the data, and between part 1 and part 2 define the one METER NUMBER to make the graph of.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 21:08:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143033#M11138</guid>
      <dc:creator>StacyRendall1</dc:creator>
      <dc:date>2013-08-27T21:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple graphs from large geodatabase table</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143034#M11139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is an example on how to accomplish this.&amp;nbsp; First, you will want to create a sample graph in ArcMap.&amp;nbsp; Here is a screen shot of the parameters I used:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]27044[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After the graph is created, right-click on it and save it out as a .grf file.&amp;nbsp; Now you can use the below code to create a graph of the "KW Demand by Meter" by specifying a meter number:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env
env.overwriteOutput = 1
env.workspace = r"C:\temp\python\test.gdb"

table = "Meters"

arcpy.TableSelect_analysis(table, r"in_memory\table_sel", "METER_NUMBER = " + arcpy.GetParameterAsText(0))

out_graph_name = arcpy.GetParameterAsText(0)
out_graph_pdf = r"C:\Temp\python\Userdata" + "\\" + arcpy.GetParameterAsText(0) + ".pdf"
input_template = r"C:\Temp\Python\UserData\KW Demand.grf" #grf file previously saved
input_data = r"in_memory\table_sel"

# Create the graph
graph = arcpy.Graph()

# Add a vertical bar series to the graph
graph.addSeriesBarVertical(input_data, "KW_DEMAND")

# Specify the title of the left axis
graph.graphAxis[0].title = "KW Demand"

# Specify the title of the bottom axis
graph.graphAxis[2].title = "Meter Number"

# Specify the title of the Graph
graph.graphPropsGeneral.title = "KW Demand by Meter"

# Output a graph, which is created in-memory
arcpy.MakeGraph_management(input_template, graph, out_graph_name)

# Save the graph as an image
arcpy.SaveGraph_management(out_graph_name, out_graph_pdf, "MAINTAIN_ASPECT_RATIO", 600, 375)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:52:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143034#M11139</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T07:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple graphs from large geodatabase table</title>
      <link>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143035#M11140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Excellent! It is great that you have written out a plan, many people don't and then get hopelessly lost... It definitely looks possible.&lt;BR /&gt;&lt;BR /&gt;Right now we'll get step 1 partly working, just printing to screen. Once that is good we can put the data in a useful data structure, rather than just printing it.&lt;BR /&gt;&lt;BR /&gt;I think James' suggestion, of using Pandas, is good. I haven't used it myself, but I think it works pretty well with time data and plotting functions. So there is something else you will need to look up and have a play with...&lt;BR /&gt;&lt;BR /&gt;Do you intend to only ever assess one meter at a time? You have a few options, but for now we may as well keep part 1 collecting all the data, and between part 1 and part 2 define the one METER NUMBER to make the graph of.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Stacy-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you for the posts. So far - I do not have much code written since I am still in the research and design phase of this project to get to the final outcome. Really looking for advice and maybe examples of different parts of the overall Python code. So far - I have some great information from different people to research and start doing some trial and error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only thing I do not have yet:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; How do I go about taking a Python script and making a "One-Click" custom button in ArcMap that when someone clicks on it - it runs the Python Script in the background?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 14:08:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-multiple-graphs-from-large-geodatabase/m-p/143035#M11140</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2013-08-28T14:08:08Z</dc:date>
    </item>
  </channel>
</rss>

