(ATCScript "TSPlot" (C This script plots the incoming timeseries.) (C The first argument is the timeseries.) (C The second argument is the time step (i.e., "DY").) (LoadLibrary "ATCScriptGraph") (Graph TITLE GraphTitle Caption) (Graph TIME sDate eDate) (Set curMax 0) (Set Color 1) (Set LocationString " ") (Set ConstituentString " ") (C For curArg in Args) (Set curArg arg1) (Set curLocation (DataTSer curArg Attrib "LOCATION")) (Set DataSetSubset (DataTSer curArg SubSetByDate SDate EDate)) (Set DataSetDaily (DataTSer DataSetSubset Aggregate arg2 1 "Sum")) (Graph DATA DataSetDaily) (C Var:Which Axis,Trans) (Graph VAR 1 1) (C Curve:Crvtyp[6-XY,Lintyp[1:Line,0:Marker],Thick,Symbol,Color,Label]) (Graph CURVE 1 1 1 0 Color curLocation) (C LocationString contains all locations in succession and is used as X-axis label) (C ConstituentString contains the subject constituent(s) and is used as Y-axis label) (Set LocationString (+ LocationString curLocation " ")) (If (Not (= curConstituent (DataTSer curArg Attrib "CONSTITUENT"))) (Set curConstituent (DataTSer curArg Attrib "CONSTITUENT")) (If (= ConstituentString " ") (Set ConstituentString curConstituent) (Else (Set ConstituentString (+ ConstituentString "/" curConstituent)) ) ) ) (If (> (DataTSer curArg Attrib "MAX") curMax) (Set curMax (DataTSer curArg Attrib "MAX")) ) (Set Color (+ Color 1)) (C need to add ")" here when loop restored) (C establish maximum y-axis value) (If (And (< 1 curMax) (> -1 curMax)) (Set curMax (Round curMax (Len curmax) "Up")) (Else (Set curMax (Round curMax (- 1 (Len curmax)) "Up")) ) ) (Graph SCALE 0 curMax 10 0 0 0 0 0 0 0 curMax 10 4 0 0 0) (Graph AXIS 0 1 0 0 " " ConstituentString "Locations - Daily" " ") (Graph SHOW) (Graph SAVE (+ OutputDir "TimSerPlot-" (DataTSer curArg Attrib "Location") ".png")) (Graph CLEAR) )