Sample 48144: Use transparent (RGBA) colors with SAS/GRAPH®

Beginning with SAS® 9.3, SAS/GRAPH now supports transparent colors, also known as RGBA colors. For example, with RGBA support, you can create transparent bars with PROC GCHART where the background image is visible behind the bars.

RGBA color names are in the form arrggbbaa, where the following is true:

a indicates to SAS that this is an RGBA color specification.

rr is the red component.

gg is the green component.

bb is the blue component.

aa is the transparency component.

As with the RGB color scheme, the components are given as hexadecimal numbers in the range 00 through FF (0% to 100%). The transparency component defines the intensity (opacity) of the color, with 00 being the most transparent and FF being the least transparent.

The sample code on the Full Code tab demonstrates how to use PROC GCHART to create a vertical bar chart with transparent bars.

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.

You must run this sample code with SAS® 9.3 in order for the transparent (RGBA) colors to work correctly.

The sample code below writes its output to the C:\TEMP directory when run on the Microsoft Windows operating system. Modify the value for the PATH= option in the ODS HTML statement in the sample code if you want to write the output to a location other than C:\TEMP or if you are running on an operating system other than Windows.

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 sample illustrates how to use transparent (RGBA) colors with SAS/GRAPH®.

Type:

Sample

Date Modified:

2012-10-16 10:04:51

Date Created:

2012-10-12 16:21:19

Operating System and Release Information

Product Family

Product

Host

SAS Release

Starting

Ending

SAS System

SAS/GRAPH

z/OS

9.3 TS1M0

Microsoft® Windows® for x64

9.3 TS1M0

Microsoft Windows Server 2003 Datacenter Edition

9.3 TS1M0

Microsoft Windows Server 2003 Enterprise Edition

9.3 TS1M0

Microsoft Windows Server 2003 Standard Edition

9.3 TS1M0

Microsoft Windows Server 2003 for x64

9.3 TS1M0

Microsoft Windows Server 2008

9.3 TS1M0

Microsoft Windows Server 2008 for x64

9.3 TS1M0

Microsoft Windows XP Professional

9.3 TS1M0

Windows 7 Enterprise 32 bit

9.3 TS1M0

Windows 7 Enterprise x64

9.3 TS1M0

Windows 7 Home Premium 32 bit

9.3 TS1M0

Windows 7 Home Premium x64

9.3 TS1M0

Windows 7 Professional 32 bit

9.3 TS1M0

Windows 7 Professional x64

9.3 TS1M0

Windows 7 Ultimate 32 bit

9.3 TS1M0

Windows 7 Ultimate x64

9.3 TS1M0

Windows Vista

9.3 TS1M0

Windows Vista for x64

9.3 TS1M0

64-bit Enabled AIX

9.3 TS1M0

64-bit Enabled HP-UX

9.3 TS1M0

64-bit Enabled Solaris

9.3 TS1M0

HP-UX IPF

9.3 TS1M0

Linux

9.3 TS1M0

Linux for x64

9.3 TS1M0

Solaris for x64

9.3 TS1M0

This content is presented in an iframe, which your browser does not support.
To view the RateIT tab, click
here.