SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Creating Bar and Pie Charts
Enhancing Charts


You've learned how to create any basic bar or pie chart. But you may also want to enhance your charts by specifying patterns other than the default values for bars or slices.

The default fill for horizontal and vertical bar charts specifies that all bars will be the same solid color. To change the default values for bar charts, you use the PATTERNID= option in the statement that specifies the chart. This topic focuses on PATTERNID=MIDPOINT, which specifies a different color/pattern combination for each bar.


General form, PATTERNID= option:
PATTERNID=<BY | MIDPOINT | GROUP | SUBGROUP>

where BY, MIDPOINT, GROUP, or SUBGROUP specify that bar colors and/or patterns vary according to the option specified.

NOTE: You cannot use the PATTERNID=MIDPOINT option when you create pie charts.


Example

This program shows the effect of the PATTERNID=MIDPOINT option on bar color and fill patterns.

     proc gchart data=clinic.insure;
        vbar company / sumvar=balancedue type=mean
             patternid=midpoint;
     run;

Vertical bar chart with patternid=midpoint option.

For comparison, the GCHART procedure below shows the default bar color and fill pattern.
     proc gchart data=clinic.insure;
        vbar company / sumvar=balancedue type=mean;
     run;

Default bar color and fill pattern.


back||next


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

Terms of Use & Legal Information | Privacy Statement