SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Creating Bar and Pie Charts
Invoking the GCHART Procedure


To create a chart using the GCHART procedure, you first reference any SAS libraries that you'll access during the SAS session. Then you
  • invoke the procedure and specify the data set to be used
  • specify the physical form that you want the chart to take (horizontal bar chart, vertical bar chart, or pie chart)
  • identify a chart variable that determines the number of bars or pie slices to create.

General form, basic GCHART step:
PROC GCHART <DATA=SAS-data-set>;
        chart-form chart-variable </ options>;
RUN;

where

  • SAS-data-set is the name of the SAS data set to be used.

  • chart-form is HBAR, HBAR3D, VBAR, VBAR3D, PIE, or PIE3D. The chart-form specifies a 2D or 3D horizontal bar chart, vertical bar chart, or pie chart, respectively.

  • chart-variable is the variable that determines the number of bars or pie slices.

  • / (slash) indicates that options follow.

  • options are any valid options for the chart form specified.
NOTE: The default statistic for GCHART is FREQ (frequency).


Let's look at an example of how the GCHART procedure works.


back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement