- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 03-07-2011 01:56 PM
(1826 views)
Hello SAS Forum.
Is there any way ,I could set a background color for the bars while using the proc sgpanel.
Here is the sample code for panels(with bars).I want to set a background for bars.
/***************************************************************************************
title1 "Average MPG (City) by Vehicle Origin and Type";
proc sgpanel data = sashelp.cars ;
panelby origin / layout=columnlattice onepanel novarname
noborder colheaderpos=top;
hbar type / response=mpg_city group=type ;
colaxis display=none ;
rowaxis label="Average MPG (City)" ;
keylegend / title="Type" position=right across=1 ;
run;
************************************************************************************/
Any idea on this??
Please let me know..
Appreciate your help.
Thanks
Siri
Is there any way ,I could set a background color for the bars while using the proc sgpanel.
Here is the sample code for panels(with bars).I want to set a background for bars.
/***************************************************************************************
title1 "Average MPG (City) by Vehicle Origin and Type";
proc sgpanel data = sashelp.cars ;
panelby origin / layout=columnlattice onepanel novarname
noborder colheaderpos=top;
hbar type / response=mpg_city group=type ;
colaxis display=none ;
rowaxis label="Average MPG (City)" ;
keylegend / title="Type" position=right across=1 ;
run;
************************************************************************************/
Any idea on this??
Please let me know..
Appreciate your help.
Thanks
Siri
7 REPLIES 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can do it by changing the wall color in the style. You can make a little style that inherits from your favorite style but just changes the wall color. Here is a little example:
[pre]
proc template;
define style styles.mybackground;
parent=styles.listing; /* or your favorite style */
style graphwalls from graphwalls /
color=yellow;
end;
run;
ods listing style=mybackground;
[/pre]
Hope this helps,
Dan
[pre]
proc template;
define style styles.mybackground;
parent=styles.listing; /* or your favorite style */
style graphwalls from graphwalls /
color=yellow;
end;
run;
ods listing style=mybackground;
[/pre]
Hope this helps,
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Dan for your quick response.
But somehow I couldn't get the background .
this is the way I proceeded:
/**************************************************************
proc template;
define style styles.mybackground;
parent=styles.listing; /* or your favorite style */
style graphwalls from graphwalls /
color=yellow;
end;
run;
ods listing file = "mybackground" ;
title1 "Average MPG (City) by Vehicle Origin and Type";
proc sgpanel data = sashelp.cars description= "mybackground";
panelby origin / layout=columnlattice onepanel novarname
noborder colheaderpos=top ;
hbar type / response=mpg_city group=type ;
colaxis display=none ;
rowaxis label="Average MPG (City)" ;
keylegend / title="Type" position=right across=1 ;
run;
/******************************************************************
Its giving me a warning:
WARNING: Unsupported device 'ACTIVEX' for LISTING destination. Using device 'ACTXIMG'.
I get the output but not with the background for bars.
Thanks again for your help.
Siri
But somehow I couldn't get the background .
this is the way I proceeded:
/**************************************************************
proc template;
define style styles.mybackground;
parent=styles.listing; /* or your favorite style */
style graphwalls from graphwalls /
color=yellow;
end;
run;
ods listing file = "mybackground" ;
title1 "Average MPG (City) by Vehicle Origin and Type";
proc sgpanel data = sashelp.cars description= "mybackground";
panelby origin / layout=columnlattice onepanel novarname
noborder colheaderpos=top ;
hbar type / response=mpg_city group=type ;
colaxis display=none ;
rowaxis label="Average MPG (City)" ;
keylegend / title="Type" position=right across=1 ;
run;
/******************************************************************
Its giving me a warning:
WARNING: Unsupported device 'ACTIVEX' for LISTING destination. Using device 'ACTXIMG'.
I get the output but not with the background for bars.
Thanks again for your help.
Siri
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The ODS LISTING statement should read:
ods listing style=mybackground;
Your example had:
ods listing file="mybackground";
Give that a try and see if that works for you.
Thanks!
Dan
ods listing style=mybackground;
Your example had:
ods listing file="mybackground";
Give that a try and see if that works for you.
Thanks!
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Dan
I did change it...
Its giving me output without any errors,but not with the background
here is what i have done.
/************************************************************************
proc template;
define style styles.mybackground;
parent=styles.listing; /* or your favorite style */
style graphwalls from graphwalls /
color=yellow;
end;
run;
ods listing style = mybackground ;
title1 "Average MPG (City) by Vehicle Origin and Type";
proc sgpanel data = sashelp.cars description= "mybackground";
panelby origin / layout=columnlattice onepanel novarname
noborder colheaderpos=top ;
hbar type / response=mpg_city group=type ;
colaxis display=none ;
rowaxis label="Average MPG (City)" ;
keylegend / title="Type" position=right across=1 ;
run;
/***********************************************************************
Am I calling the template correctly in the Panel block?
Thanks
Sri
I did change it...
Its giving me output without any errors,but not with the background
here is what i have done.
/************************************************************************
proc template;
define style styles.mybackground;
parent=styles.listing; /* or your favorite style */
style graphwalls from graphwalls /
color=yellow;
end;
run;
ods listing style = mybackground ;
title1 "Average MPG (City) by Vehicle Origin and Type";
proc sgpanel data = sashelp.cars description= "mybackground";
panelby origin / layout=columnlattice onepanel novarname
noborder colheaderpos=top ;
hbar type / response=mpg_city group=type ;
colaxis display=none ;
rowaxis label="Average MPG (City)" ;
keylegend / title="Type" position=right across=1 ;
run;
/***********************************************************************
Am I calling the template correctly in the Panel block?
Thanks
Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hey Siri,
Your code runs correctly for me. Try restarting your SAS session and see if that helps. Your session may be in a state where the style request is getting ignored. Let me know if that works for you.
Thanks!
Dan
Your code runs correctly for me. Try restarting your SAS session and see if that helps. Your session may be in a state where the style request is getting ignored. Let me know if that works for you.
Thanks!
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hey Dan
Its the same problem again...
No background
Siri
Its the same problem again...
No background
Siri
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Dan
Appreciate your help.
Siri
Appreciate your help.
Siri