Data visualization with SAS programming

format sumvar values in proc gchart

Reply
Regular Contributor
Posts: 201

format sumvar values in proc gchart

I am using this code:

 

 

pattern1 color=green;
axis1 label=(a=0 f= "Arial/bold" "Bla" ) color=black minor =(n=2) value=(angle=0);
axis2 label=(f="Arial/bold" "Bla") color=black value=(angle=90);

proc gchart data=Bla(where=(Bla = "&Bla." and Bla='YES'));
	title1 f="Arial/bold" c=black &Title.;
	format Bla NLMNLGBP32.0;
	vbar3d TBla / sumvar=Bla
		width=15
		outside=sum
		descending
		raxis=axis1
		maxis=axis2 
		legend=
		;	
run;
quit;

Is there a way of applying an angle (e.g. 45 degrees) to the values of sumvar and even make these values bold? Thanks.

 

Super User
Posts: 13,083

Re: format sumvar values in proc gchart

Posted in reply to csetzkorn

When you start wanting to control appearance of sumvar text properties, font, size angles rotation or such then you move into ANNOTATE data sets.

 

Check to see if your online help has an example named "Labeling Subgroups in a vertical Bar Chart" to get started.

Regular Contributor
Posts: 201

Re: format sumvar values in proc gchart

Thanks I came across this. Is this really the only way )-:
Super User
Posts: 13,083

Re: format sumvar values in proc gchart

Posted in reply to csetzkorn

csetzkorn wrote:
Thanks I came across this. Is this really the only way )-:

Are you going to do this frequently with many different data sets? Also which version of SAS are you using as graphics options change with each release for the statistical graphics pro

 

If so then you may want to consider 1) changing from Gchart to Sgplot and 2) modifying an ODS style template to display data labels that way or Use Sgplot with a SUMMARIZED data set so you know the values and use Sgplot with a VBARPARM and a TEXT plot to overlay text at locations which allows rotation.

 

The annotate sets aren't that difficult to make as there are a number of macros, but any time you want to control more elements of output you have to do more work somewhere along the line.

 

 

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