| Date: | Tue, 10 May 2005 11:50:25 -0400 |
| Reply-To: | Ya Huang <ya.huang@AMYLIN.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Ya Huang <ya.huang@AMYLIN.COM> |
| Subject: | Re: SAS-GRAPH bar color |
|
Try subgroup and pattern:
data xx;
country=1; score=3; output;
country=2; score=1; output;
country=3; score=12; output;
country=4; score=7; output;
country=5; score=9; output;
run;
* sort by score;
proc sort;
by score;
run;
* give new country code, for AP a special code 255 will be used;
data xx;
set xx;
newcountry=_n_;
if country=5 then newcountry=250;
run;
* sort by new country code;
proc sort;
by newcountry;
run;
* all pattern will be green, except pattern250 which will be AP;
proc format;
value ccode
250='red'
other='green'
;
value country
1='CHN'
2='JAP'
3='KOR'
5='AUS'
250='AP'
;
* create a set of pattern statement;
options symbolgen;
proc sql noprint;
select 'pattern'||trim(put(newcountry,best.-l))||' color='||trim(put
(newcountry,ccode.-l))
into :colfmt separated by ';'
from xx
;
goptions reset=all;
&colfmt;
proc gchart;
vbar newcountry / discrete sumvar=score subgroup=newcountry nolegend;
format newcountry country.;
run;
128 &colfmt;
SYMBOLGEN: Macro variable COLFMT resolves to pattern1 color=green;pattern2
color=green;pattern3 color=green;pattern5 color=green;pattern250
color=red
129
Kind regards,
Ya Huang
On Tue, 10 May 2005 04:52:41 -0700, easwara@GMAIL.COM wrote:
>Hi All,
>
>Is it possible to color only one bar out of the other in a different
>color?? I have all Asia pacific countries BAR, plus a AP Region
>bar(computed). I wann to show the AP region Bar in a Diffrent color.
>
>Also, I've arranged the BARS in ascending order. Is it possible to have
>all countries bars ascending , and a final bar for the AP
>region(irrespective of its value).
>
>any help will be helpful!! :)
>
>Thanks
>Easwara
|