BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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.
1 REPLY 1
Cynthia_sas
Diamond | Level 26
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

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1249 views
  • 0 likes
  • 2 in conversation