Plot the Total Criminal Offenses over Time

To show the trend of each criminal offense from 1989 to 2008, use a line plot.
  1. On the SAS tab, click Tasks, and then select Graphthen selectLine Plot. The Choose Data dialog box appears.
  2. To use the sorted data as your input data source, select SAS Data in Excel. This option uses the output data set that was generated by the Sort Data task and saved to the SAS server. The data set on the server is the same as the data in the SASDATA.SORTED_CRIME_DATA worksheet.
  3. For the location of the results, select New worksheet. By default, the name of the new worksheet is Line Plot.
    Choose Data dialog box for the Line Plot task
    Click OK. The Line Plot task appears.
  4. In the Line Plot panel, select Multiple vertical column line plots using overlay.
    Selecting the line type in the Line Plot panel
    In the selection pane, click Data.
  5. In the Data panel, complete these steps:
    1. Assign the Year column to the Horizontal role.
    2. Assign the Murder and nonnegligent manslaughter, Robbery, Aggravated assault, and Burglary columns to the Vertical role.
    Data panel in the Line Plot task
    In the selection pane, click General under the Appearance > Axes heading.
  6. In the Appearance > Axes > General panel, select the Display Grid Lines check box.
    In the selection pane, click Axis under the Vertical Axis heading.
  7. In the Appearance > Axes > Vertical Axis > Axis panel, enter Number of Offenses in the Label field.
    Changing the Label of the Vertical Axis in the Line Plot task
    In the selection pane, click Titles.
  8. In the Titles pane, modify the title and the footnote for the line plot.
    To change the title:
    1. In the Section area, select Graph. In the Text for section: Graph area, deselect the Use default text check box.
    2. Delete the default text and enter Total Criminal Offenses over Time.
    To change the footnote:
    1. In the Section area, select Footnote. In the Text for section: Footnote area, deselect the Use default text check box.
    2. Modify the text of the footnote to read Updated %TRIM(%QSYSFUNC(DATE(), NLDATE20.)) at %TRIM(%SYSFUNC(TIME(), NLTIMAP20.)).
    Changing the text of the footnote in the Line Plot task
    Click Run. The generated line plot appears in the new Line Plot worksheet. Your results could look similar to the following display:
    Results from the Line Plot task
    Tip
    You can customize the title of the plot and the footnote by using the formatting tools in Excel.