BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DavidPhillips2
Rhodochrosite | Level 12
proc template;  
	  define statgraph statGraphName style ;
	    dynamic TITLE1 TITLE2 TITLE3;
		begingraph;
		  entrytitle TITLE1;

How can I include a color style along with other options in proc template?  I know this is a simple question but I’m having a hard time finding examples in documentation.  My objective is to set the header color for the template.

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi, This worked for me in SAS 9.4 M3, but did not work in SAS 9.4 M0 (got an error on PANELBY statement). I don't have any other versions to test with. You might want to check with Tech Support or post your question on the SAS/GRAPH and ODS GRAPHICS forum. ( I like pink better than red. So the color should not make a difference -- however, SAS does have a registry list of colors and if you specify a color that isn't in the registry list, it is possible that the color you specify will be mapped to a different color. This happens when you use "named" colors like aliceblue or red or pink -- they always get "translated" to their RGB equivalent.)

 

cynthia

 

headerbackcolor.png

 

and, when I use CXFFBA00, this is what I get...is this what you're expecting???

 

cxffba00.png

View solution in original post

9 REPLIES 9
Reeza
Super User

Define header colour, is that the text, the background, the border of the header?

DavidPhillips2
Rhodochrosite | Level 12

Boarder of the header.  In proc report it would be style(header)=[background=#FFBA00]

 

I'm trying to do the same thing for proc sgpannel.


header.png
DavidPhillips2
Rhodochrosite | Level 12

proc sgpanel data=sashelp.class;

panelby sex / headerbackcolor=red;

 scatter y=age x=age;

 run;

DavidPhillips2
Rhodochrosite | Level 12

This doesn't work for setting custom colors FFBA00 is changes the color but has the same result as F9DF97.

Cynthia_sas
SAS Super FREQ

Hi, This worked for me in SAS 9.4 M3, but did not work in SAS 9.4 M0 (got an error on PANELBY statement). I don't have any other versions to test with. You might want to check with Tech Support or post your question on the SAS/GRAPH and ODS GRAPHICS forum. ( I like pink better than red. So the color should not make a difference -- however, SAS does have a registry list of colors and if you specify a color that isn't in the registry list, it is possible that the color you specify will be mapped to a different color. This happens when you use "named" colors like aliceblue or red or pink -- they always get "translated" to their RGB equivalent.)

 

cynthia

 

headerbackcolor.png

 

and, when I use CXFFBA00, this is what I get...is this what you're expecting???

 

cxffba00.png

DavidPhillips2
Rhodochrosite | Level 12

Cynthia, thanks for solving the color display.

 

How did you convert the hex color FFBA00 to CXFFBA00 ?  I need to make sure it is the same color.

DavidPhillips2
Rhodochrosite | Level 12

Do I need to create a style to create a color gradient for the bars of a group by in sgpannel?  Is this done style template?  Can you recomend a good example to base off of?

Cynthia_sas
SAS Super FREQ
Off the top of my head, I think that gradients do need to be specified in the style template. I think it is a startcolor and an endcolor style attribute that defines the gradient range. The better place to post this question would be in the ODS GRAPHICS forum or by opening a track with Tech Support.
Here's the web page that describes the ODS STYLE attributes/elements that can be used with ODS GRAPHICS:
http://support.sas.com/documentation/cdl/en/grstatproc/67909/HTML/default/viewer.htm#n02bywwj20lelzn...

cynthia
Cynthia_sas
SAS Super FREQ
hi, David...I did not do any "translation" .. the FF is Red value in hex; the BA is Green value in hex; the 00 is Blue value in hex. All I did was put CX in front of the number because that is how SAS determines that the number is an RGB number. In HTML, you might be able to get away without the # in #FFBA00 -- but for SAS and ODS with RGB values it is better to preface them with CX.

If you want to verify a color value, go on the web to one of the "interactive" RGB color pickers, sometimes they are called HTML color pickers and spin the values or type the values in to see the color.

In the SAS color naming systems, you can have CX for RGB colors, HLS for Hue, Lightness and saturation, GRAY## for grayscale values and a few others, like HSV or CMYK as described here:
http://support.sas.com/documentation/cdl/en/grstatug/67914/HTML/default/viewer.htm#p0edl20cvxxmm9n1i...

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 1949 views
  • 3 likes
  • 3 in conversation