GTILE Procedure

Example 4: Specifying Discrete Tile Colors

Features:

FLOW statement options COLORVAR= and COLORTYPE=

Data set: SASHELP.ORSALES
In this example, PROC GTILE generates the chart shown in Tile Chart That Uses Discrete Tile Colors for a subset of SASHELP.ORSALES. The FLOW statement defines the layout of the data. The tile sizes are determined by the total profits that were generated by each product group for each year. The COLORVAR=YEAR specifies that the color of each tile represents the sales revenue for that product group for that year. The COLORTYPE= option specifies that discrete colors are to be used. The GOPTIONS statement COLORS= option is used to specify that the discrete colors CXFFCCCC (light red), CXCCCCFF (light blue), CXCCFFCC (light green), and CXFFFFCC (light yellow) are to be used in the chart instead of the default GraphData1 through GraphData4 colors.
Tile Chart That Uses Discrete Tile Colors
Tile Chart that Uses Discrete Tile Colors

Program

goptions reset=all border device=javaimg
   colors=(cxffcccc cxccccff cxccffcc cxffffcc);
proc gtile data=sashelp.orsales (where=(product_line="Sports"));
    flow profit tileby=(product_group year) /
        colorvar=year
        colortype=discrete;
run;
quit;

Program Description

Here is a detailed description of the SAS program.
Specify the graphics options. Specify JAVAIMG as the device and specify custom chart colors.
goptions reset=all border device=javaimg
   colors=(cxffcccc cxccccff cxccffcc cxffffcc);
Generate the tile chart using YEAR as the color variable and DISCRETE as the color type.
proc gtile data=sashelp.orsales (where=(product_line="Sports"));
    flow profit tileby=(product_group year) /
        colorvar=year
        colortype=discrete;
run;
quit;