SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Creating Bar and Pie Charts
Enhancing Charts


Another aspect of charts that you can modify is the fill for pie slices. By default, pie charts start with a solid fill, rotating through the colors in the color list once. If there are additional slices, the fill changes to the next pattern in the list and rotates through the color list again.

To change the fill pattern to either all solid or all hatch, you can use the FILL= option in the PIE or PIE3D statement.


General form, FILL= option:
FILL=<X|S>

where

  • X changes the fill pattern for all slices to hatch
  • S changes the fill pattern for all slices to solid.

NOTE: You cannot use the FILL= option with bar charts.


Example

This program shows the default color and fill pattern for pie charts. Note that both solid and hatch patterns are used.

     proc gchart data=clinic.insure;
        pie company / sumvar=balancedue type=mean;
     run;

Pie chart with default colors and fill patterns.

The program below shows how the FILL=X option changes the slice patterns. Only one hatch pattern  is used, and it rotates through the color list. Note that one color (green) is used twice because there were not as many colors in the color list as there are slices in the chart (some colors were assigned to companies with no balance due or companies included in OTHER).
     proc gchart data=clinic.insure;
        pie company / sumvar=balancedue type=mean fill=x;
     run;

Pie chart with FILL=X option.

This program shows how the FILL=S option changes the slice patterns to solid fill.
     proc gchart data=clinic.insure;
        pie company / sumvar=balancedue type=mean fill=s;
     run;

Pie chart with FILL=S option.


back||next


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

Terms of Use & Legal Information | Privacy Statement