Data visualization with SAS programming

How to control the hight of bars in proc gchart vbar

Reply
Frequent Contributor
Posts: 117

How to control the hight of bars in proc gchart vbar

Hi SAS experts,

 

Am trying to control the hights of bar graph.How can I controll the hights of bar graph..Below is my code..please help

 

axis1 label=none major=none minor=none style=0
value=none;
axis2 label=none;
legend1 label=(position=top) position=(right middle)
across=1 shape=bar(.11in,.11in);


pattern1 v=solid color=CXB22222;
pattern2 v=solid color=CXFF00FF;
pattern3 v=solid color=CXB8860B;
/*pattern4 v=solid color=CX8B4513;*/
/*pattern5 v=solid color=CX556B2F;*/
/*pattern6 v=solid color=CX6495ED;*/
/*pattern7 v=solid color=CX4169E1;*/


ods pdf file="path&name..pdf";
proc gchart data=test&name.;
vbar3d YEAR / discrete
sumvar=sales
shape=cylinder
subgroup=type
cframe=grayaa
caxis=black
width=10
space=4
legend=legend1
maxis=axis2
raxis=axis1
des="total sales for &name.";
run;
quit;

ods pdf close;

Super User
Posts: 19,194

Re: How to control the hight of bars in proc gchart vbar

I'm confused. 

In your current code SUMVAR controls the height. If you want something else you'll have to clarify. 

 

Super User
Posts: 11,144

Re: How to control the hight of bars in proc gchart vbar

The apparent height is going to be controlled by combinations of the device display area and the axis settings. For example if you vertical axis is set to diplay y values from 0 to 100 your bar heights will be different than if the axis is showing 0 to 50 for the same device settings. If you do not specify the y axis options such as ORDER, to control tickmarks, then SAS will generate a default one that displays the values involved and will vary depending on the data. .

Ask a Question
Discussion stats
  • 2 replies
  • 189 views
  • 0 likes
  • 3 in conversation