Help using Base SAS procedures

SAS Graph

Reply
N/A
Posts: 0

SAS Graph

Hi All,

I am using PROC GCHART to draw the vbar3d.I am using like this..



proc gchart data=sample;
vbar3d sex_cat / sumvar=total ;
run;
quit;


Here i want the bar shoulb be in green colour if total greater than 1500 else it would be red in colour.

So please give me some suggestions.

Thanks.
SAS Super FREQ
Posts: 8,868

Re: SAS Graph

Posted in reply to deleted_user
Hi:
You might look at the SUBGROUP option. This might mean that you have to "pre-summarize" your data, so that you can creating a subgrouping variable based on your condition. (instead of graphing the unsummarized data, then, you would graph the summarized data). You could use DATA step logic or a user-defined format to set a value for the subgrouping variable. But, no matter how you set the subgrouping variable -- let's call this subgrouping variable, Category.

Then, your VBAR3D statement would look something like this:
[pre]
vbar3d graph_var / sumvar=numvar
subgroup=Category;
[/pre]

Without any specific instructions, SAS/Graph will cycle through the current color list. You can explicitly set PATTERN statements to control the colors of the subgrouped bars. If you had 4 categories, then you would use 4 PATTERN statements, if you only had 2 categories, then you would use 2 PATTERN statements.

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 108 views
  • 0 likes
  • 2 in conversation