LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (May 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 2 May 2005 13:12:32 -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: Proc GChart/Axis values in differenct colors
Comments: To: Srinivas Reddy Valisekkagari <reddy.srinivas@GMAIL.COM>

You can create a pattern list based on the x value for each month, which can be done be proc sql and format, then apply the patterns to proc gchart:

data xx; do month=1 to 12; pct=int(ranuni(2)*100); output; end; run;

proc format; value pctcol 0-50='red' 51-75='green' 76-100='blue' ;

options symbolgen; proc sql noprint; select 'pattern'||trim(put(month,best.-l))||' color='||trim(put(pct,pctcol.- l)) into :colfmt separated by ';' from xx ;


proc gchart; hbar month / discrete sumvar=pct subgroup=month nolegend; run;

455 &colfmt; SYMBOLGEN: Macro variable COLFMT resolves to pattern1 color=red;pattern2 color=blue;pattern3 color=blue;pattern4 color=green;pattern5 color=blue;pattern6 color=blue;pattern7 color=red;pattern8 color=red;pattern9 color=red;pattern10 color=red;pattern11 color=green;pattern12 color=red 456 NOTE: PROCEDURE SQL used:

The above log shows how the pattern statements were built up.


Ya Huang

On Mon, 2 May 2005 11:28:51 -0400, Srinivas Reddy Valisekkagari <reddy.srinivas@GMAIL.COM> wrote:

>Hi, > I have a bar chart(hbar) with Month on y-axis and corresponding % >values on x-axis. > >ex:- >=== >Jan 80% >Feb 90% >Mar 95% > >In the Graph based on % values ,i want to change the color of y-axis values >based on conditions like : > >if % <= 80 then show axis value in RED > >if 90 <= % < 80 then axis value is Blue > >if % > 90 then axis value is Green. > >Is there a way to accomplish this ? I am using SAS Version 8.2. > >Any help/suggestions will be appreciated. > >Thanks, >-Reddy

Back to: Top of message | Previous page | Main SAS-L page