Sample 25502: Scaling data-dependent output using PROC GANNO
This example uses an Annotate data set to scale data-dependent output with the DATASYS option and create a vertical bar chart of sales for each of six sites.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This example uses an Annotate data set to scale data-dependent output with the DATASYS option and create a vertical bar chart of sales for each of six sites.
The graphics output in the Results tab was produced using SAS® 9.2. Submitting
the sample code with releases of SAS prior to SAS 9.2 might produce different results.
/* Set the graphics environment */
goptions reset=all cback=white border htitle=12pt htext=10pt;
/* Create data set of sales information */
data wrldtotl;
length Sitename $ 10;
input Sitename $ 1-10 Mean 12-15;
datalines;
Paris 999
Munich 571
Tokyo 137
London 273
Frankfurt 546
New York 991
;
run;
/* Create the Annotate data set */
data wrldanno;
length function color $ 8 text $ 25 style $ 25;
retain line 0 xsys ysys '2' hsys '3' x 8;
set wrldtotl end=end;
/* Position the cursor at the beginning point */
function='move'; x=x+8; y=20; output;
/* Draw bars representing number of sales */
function='bar'; y=y+(mean); x=x+9;
style='empty'; color='depk'; output;
/* Label the bars with name of site */
function='label'; y=0; x=x-4; size=3.5;
position='E'; style="'Albany AMT'";
color='black'; text=sitename; output;
/* Label the bars with the value of MEAN */
function='move'; y=y+(mean)-3; output;
function='label'; x=x-1; text=left(put(mean,3.));
position='5'; style="'Albany AMT'"; size=3; output;
/* At end of data set, add an axis line, */
/* title, footnote, and frame */
if end then do;
/* Draw a the axis line */
function='move'; x=10; y=20; output;
function='draw'; x=90; y=20; line=1;
size=.5; color='CX7C95CA'; output;
/* Write the title */
function='label'; x=50; y=95; text='Projected Sales';
xsys='3'; ysys='3'; position='5'; style="'Albany AMT'";
size=5; color='black'; output;
/* Write the footnote */
x=85; y=3; size=3; style="'Albany AMT'";
text='Sample Annotate Output'; output;
/* Draw a frame */
function='frame'; color='black'; when='b';
style='empty'; output;
end;
run;
/* Display the annotation, scaling */
/* the data with the DATASYS option */
proc ganno annotate=wrldanno datasys;
run;
quit;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.

This example uses an Annotate data set to scale data-dependent output with the DATASYS option and create a vertical bar chart of sales for each of six sites.
| Date Modified: | 2005-07-20 03:02:43 |
| Date Created: | 2005-05-23 14:11:44 |
Operating System and Release Information
| SAS System | SAS/GRAPH | z/OS | 9.1 TS1M0 | |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M0 | |
| Microsoft Windows 2000 Advanced Server | 9.1 TS1M0 | |
| Microsoft Windows 2000 Datacenter Server | 9.1 TS1M0 | |
| Microsoft Windows 2000 Server | 9.1 TS1M0 | |
| Microsoft Windows 2000 Professional | 9.1 TS1M0 | |
| Microsoft Windows NT Workstation | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M0 | |
| Microsoft Windows XP Professional | 9.1 TS1M0 | |
| 64-bit Enabled AIX | 9.1 TS1M0 | |
| 64-bit Enabled HP-UX | 9.1 TS1M0 | |
| 64-bit Enabled Solaris | 9.1 TS1M0 | |
| HP-UX IPF | 9.1 TS1M0 | |
| Linux | 9.1 TS1M0 | |
| OpenVMS Alpha | 9.1 TS1M0 | |
| Tru64 UNIX | 9.1 TS1M0 | |