%let minval=-100; data sas_revenue; drop unit; input Year Revenue unit $ @@; format revenue dollar.; min=&minval; if unit='billion' then revenue=revenue*1e3; r1 = min(revenue, 1000); r2 = min(revenue, 2000); datalines; 2010 2.43 billion 2009 2.31 billion 2008 2.26 billion 2007 2.15 billion 2006.5 2.0 billion 2006 1.90 billion 2005 1.68 billion 2004 1.53 billion 2003 1.34 billion 2002 1.18 billion 2001 1.13 billion 2000 1.12 billion 1999 1.02 billion 1998 871.4 million 1997 750.0 million 1996 652.8 million 1995 562.4 million 1994 481.9 million 1993 420.2 million 1992 365.5 million 1991 295.4 million 1990 240.2 million 1989 205.6 million 1988 170.4 million 1987 135.3 million 1986 102.4 million 1985 70.9 million 1984 52.6 million 1983 32.3 million 1982 19.6 million 1981 11.2 million 1980 5.05 million 1979 2.3 million 1978 1.2 million 1977 0.506 million 1976 0.138 million ; run; ods html close; ods listing; /*--Simple graph--*/ ods graphics / reset width=5in height=3in imagename='SAS_Revenue_SG'; title "SAS Revenue History (in Millions)"; proc sgplot data=sas_revenue noautolegend; band x=year upper=revenue lower=&minval / transparency=0.5 y2axis; series x=year y=revenue / lineattrs=(thickness=5 color=cx2f2f7f) y2axis; xaxis grid offsetmin=0 offsetmax=0 display=(nolabel) valueshint values=(1980 to 2010 by 5); y2axis grid offsetmin=0 display=(nolabel); run; /*--Gradiated band with Stat Table--*/ ods graphics / reset width=6in height=3in imagename='SAS_Revenue_SG_Stat'; title "SAS Revenue History (in Millions)"; proc sgplot data=sas_revenue noautolegend; band x=year upper=revenue lower=r2 / transparency=0.2 y2axis; band x=year upper=r2 lower=r1 / transparency=0.5 y2axis; band x=year upper=r1 lower=&minval / transparency=0.8 y2axis; series x=year y=revenue / lineattrs=graphdata1(thickness=5 color=cx2f2f7f) y2axis; inset ("Number of Countries Installed" = "- 128" "Worldwide Customer Sites" = "> 50,000" "Worldwide Employees" = "- 12,479") / textattrs=(weight=bold color=cx2f2f7f) position=bottomright; xaxis grid offsetmin=0 offsetmax=0 display=(nolabel) valueshint values=(1980 to 2010 by 5); y2axis grid offsetmin=0 display=(nolabel); run; /*--Annotation Data set--*/ data sg_anno; length function $12; length x1 y1 x2 y2 8; retain drawspace "DATAVALUE"; length shape $12; retain yaxis "Y2" anchor "RIGHT" justify "CENTER"; retain width 7 textsize 8 textweight "BOLD" textcolor "cx2f2f7f"; retain linecolor "cx2f2f7f"; length label $20; function="ARROW"; y2=1000; y1=y2+200; x2=1998.5; x1=x2-2; shape='FILLED'; label=' '; output; function="TEXT"; label="1999 $1.0B"; output; function="ARROW"; y2=2000; y1=y2+200; x2=2006; x1=x2-2; shape='FILLED'; label=''; output; function="TEXT"; label="2006 $2.0B"; output; function="ARROW"; y2=2450; y1=y2+200; x2=2009.5; x1=x2-2; shape='FILLED'; label=''; output; function="TEXT"; label="2010 $2.4B"; output; run; /*--Graph with Annotation--*/ ods graphics / reset width=6in height=4in imagename='SAS_Revenue_SG_Anno'; title "SAS Revenue History (in Millions)"; proc sgplot data=sas_revenue noautolegend sganno=sg_anno; band x=year upper=revenue lower=r2 / transparency=0.2 y2axis; band x=year upper=r2 lower=r1 / transparency=0.5 y2axis; band x=year upper=r1 lower=&minval / transparency=0.8 y2axis; series x=year y=revenue / lineattrs=graphdata1(thickness=5 color=cx2f2f7f) y2axis; inset ("Number of Countries Installed" = "- 128" "Worldwide Customer Sites" = "> 50,000" "Worldwide Employees" = "- 12,479") / textattrs=(weight=bold color=cx2f2f7f) position=bottomright; xaxis grid offsetmin=0 offsetmax=0 display=(nolabel) valueshint values=(1980 to 2010 by 5); y2axis grid offsetmin=0 display=(nolabel) offsetmax=0.1; run;