Creating the Create Line Plot tool
The Create Line Plot tool will create a line plot that depicts the number of crimes over time. This tool will be added to the Crime Analysis toolbox created in the previous chapter. It will use a combination of ArcPy
and Plotly
to create the graph.
This tool will use an existing point feature class layer imported with the Import Records tool. It will aggregate the total number of crimes by the month and plot the results to a line plot graph. Input parameters will include the feature
class and field to be charted, along with a chart title, location, and filename for the output chart:
If required, open
C:\ArcGIS_Blueprint_Python\ch5\SeattleCrimes.mxd
in ArcMap.Locate the
CrimeAnalysis.pyt
toolbox that was created in the last chapter.Open the code for the toolbox in your Python development environment.
Copy and paste one of the existing tools at the bottom of the
CrimeAnalysis.pyt
file.Rename the class
CreateLinePlot
.Remove the code inside the
getParameterInfo...