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
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register 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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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