Setting the Size of Your Graph

You can use graphics options to control the size of your graph. Each device uses a default size for the graphics that they generate. You can use the HSIZE= and VSIZE= graphics options to override the default size of your graphics area, or the XPIXELS= and YPIXELS= graphics options to override the default size of your graph.

Using the HSIZE= and VSIZE= Graphics Options to Set the Size of Your Graphics Area

You can use the HSIZE= and VSIZE= graphics options to change the default size of the graphics area for the device that you are using. The HSIZE= option sets the horizontal dimension, while the VSIZE= option sets the vertical dimension. You can specify the dimension in inches (in), centimeters (cm), or points (pt). The default unit is inches (in).
Note: For the ODS PRINTER, ODS PDF, ODS PS, and ODS PCL destinations, the page area (easel) is determined by the printer's default paper size or by the PAPERSIZE= option.
Here is an example that creates a 20 centimeter wide by 10 centimeter high GIF image of a graph.
option gstyle;
ods html close;
ods listing style=statistical;
goptions reset=all device=gif hsize=20cm vsize=10cm;

proc gchart data=sashelp.cars;
   vbar Make;
      where MPG_Highway >= 37;
   run;
quit;
ods listing close;
ods html;

Using the XPIXELS= and YPIXELS= Graphics Options to Set the Size of Your Graph

When you use a display device , Universal Printer device, or Universal Printer shortcut device with the ODS LISTING, ODS HTML, or ODS RTF destination, you can use the XPIXELS= and YPIXELS= graphics options to set the size of the graph without having to modify the device. Setting only the XPIXELS= and YPIXELS= options affects the size of the graph, but does not affect the resolution.
Note: The XPIXELS= and YPIXELS= graphics options are partially supported by the ACTIVEX and JAVA devices.
The ODS PRINTER, ODS PDF, ODS PS, and ODS PCL destinations do not honor the XPIXELS= and YPIXELS= graphics options. For these destinations, you must use the HSIZE= and VSIZE= graphics options to set the graph size. See Using the HSIZE= and VSIZE= Graphics Options to Set the Size of Your Graphics Area.
Here is an example that creates a 600 pixel wide by 800 pixel high GIF image of a graph.
option gstyle;
ods html close;
ods listing style=statistical;
goptions reset=all device=gif xpixels=600 ypixels=800;

proc gchart data=sashelp.cars;
   vbar Make;
      where MPG_Highway >= 37;
   run;
quit;
ods listing close;
ods html;
Notice that XMAX= and YMAX= are not set. In this example, the SAS/GRAPH software recomputes the XMAX= and YMAX= values to retain the original resolution for the new graph size.