You can customize the symbols on graphs that you generate with the Graph Template Language (GTL) by using the SYMBOLCHAR and SYMBOLIMAGE statements. These statements are available beginning in the first maintenance release of SAS® 9.4 (TS1M1).
The sample code on the Full Code tab illustrates how to specify a custom symbol using the SYMBOLCHAR statement. Custom symbols are defined as Unicode values. A list of valid Unicode values can be found here.
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.
data temperatures;
input Day : $9. High Low Forecast $7.;
datalines;
Monday 73 61 Cloudy
Tuesday 76 60 Showers
Wednesday 79 59 Sunny
Thursday 80 60 Sunny
Friday 79 64 Showers
Saturday 73 63 Cloudy
Sunday 75 64 Showers
;
run;
proc template;
define statgraph temp;
begingraph;
entrytitle 'Temperatures in Cary, NC';
entrytitle ' The Week of September 1';
symbolchar name=cloudy char='2601'x /;
symbolchar name=sunny char='2600'x / ;
symbolchar name=showers char='2602'x / ;
discreteattrmap name='symbolmap';
value 'Sunny' / markerattrs=(symbol=sunny color=orange);
value 'Cloudy' / markerattrs=(symbol=cloudy color=grey);
value 'Showers' / markerattrs=(symbol=showers color=blue);
enddiscreteattrmap;
discreteattrvar attrvar=sign var=forecast attrmap='symbolmap';
layout overlay / xaxisopts=(label='Day of the Week');
highlowplot x=day low=low high=high / lineattrs=(color=biyg thickness=20pt);
scatterplot x=day y=eval(high + 1) / group=sign markerattrs=(size=25pt) name='weather';
discretelegend 'weather' / title='Forecast';
innermargin / align=bottom;
axistable x=day value=high / valueattrs=(size=9pt weight=bold);
axistable x=day value=low / valueattrs=(size=9pt weight=bold);
endinnermargin;
endlayout;
endgraph;
end;
run;
proc sgrender template=temp data=temperatures;
run;
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.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> SGRENDER Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Template Language (GTL) |
Date Modified: | 2014-10-14 14:03:25 |
Date Created: | 2014-10-10 14:38:36 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | Base SAS | Microsoft Windows 8 Pro x64 | 9.4 TS1M1 | |
Microsoft Windows 8 Pro 32-bit | 9.4 TS1M1 | |||
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M1 | |||
Microsoft Windows 8 Enterprise 32-bit | 9.4 TS1M1 | |||
Microsoft® Windows® for x64 | 9.4 TS1M1 | |||
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.4 TS1M1 | |||
z/OS | 9.4 TS1M1 | |||
Z64 | 9.4 TS1M1 | |||
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 TS1M1 | |||
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M1 | |||
Microsoft Windows 8.1 Pro | 9.4 TS1M1 | |||
Microsoft Windows 8.1 Pro 32-bit | 9.4 TS1M1 | |||
Microsoft Windows Server 2008 | 9.4 TS1M1 | |||
Microsoft Windows Server 2008 R2 | 9.4 TS1M1 | |||
Microsoft Windows Server 2008 for x64 | 9.4 TS1M1 | |||
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M1 | |||
Microsoft Windows Server 2012 R2 Datacenter | 9.4 TS1M1 | |||
Microsoft Windows Server 2012 R2 Std | 9.4 TS1M1 | |||
Microsoft Windows Server 2012 Std | 9.4 TS1M1 | |||
Windows 7 Enterprise 32 bit | 9.4 TS1M1 | |||
Windows 7 Enterprise x64 | 9.4 TS1M1 | |||
Windows 7 Home Premium 32 bit | 9.4 TS1M1 | |||
Windows 7 Home Premium x64 | 9.4 TS1M1 | |||
Windows 7 Professional 32 bit | 9.4 TS1M1 | |||
Windows 7 Professional x64 | 9.4 TS1M1 | |||
Windows 7 Ultimate 32 bit | 9.4 TS1M1 | |||
Windows 7 Ultimate x64 | 9.4 TS1M1 | |||
64-bit Enabled AIX | 9.4 TS1M1 | |||
64-bit Enabled HP-UX | 9.4 TS1M1 | |||
64-bit Enabled Solaris | 9.4 TS1M1 | |||
HP-UX IPF | 9.4 TS1M1 | |||
Linux for x64 | 9.4 TS1M1 | |||
Solaris for x64 | 9.4 TS1M1 |