Desktop productivity for business analysts and programmers

Proc GCHART: Rotate Text for Categorical Variable (x axis)

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Proc GCHART: Rotate Text for Categorical Variable (x axis)

New SAS user here. 

 

I'm trying to generate a basic bar chart displaying average scores. The bars are grouped by  "Analyst" names. When I run the code, the graph text displaying the names (Analyst Value) is positioned vertically. How do I rotate the text of the category values to make it readable?

 

proc gchart data=work.qa_data;
	vbar Analyst / type=mean sumvar=Total_Score space=3 width=4;
run;

img0.png

 

 


Accepted Solutions
Solution
‎01-24-2018 02:19 PM
Respected Advisor
Posts: 2,661

Re: Proc GCHART: Rotate Text for Categorical Variable (x axis)

Posted in reply to jmobball34

something like this

 

axis1 value=(angle=90);
proc gchart data=work.qa_data;
	vbar Analyst / type=mean sumvar=Total_Score space=3 width=4 maxis=axis1;
run;
--
Paige Miller

View solution in original post


All Replies
Solution
‎01-24-2018 02:19 PM
Respected Advisor
Posts: 2,661

Re: Proc GCHART: Rotate Text for Categorical Variable (x axis)

Posted in reply to jmobball34

something like this

 

axis1 value=(angle=90);
proc gchart data=work.qa_data;
	vbar Analyst / type=mean sumvar=Total_Score space=3 width=4 maxis=axis1;
run;
--
Paige Miller
Super User
Posts: 22,874

Re: Proc GCHART: Rotate Text for Categorical Variable (x axis)

Posted in reply to jmobball34
And just a quick note, that if you're new to SAS and graphing, using SG procedures is a better way to go, in particular SGPLOT. The Graph procedures are limited and don't look as nice.
Respected Advisor
Posts: 2,661

Re: Proc GCHART: Rotate Text for Categorical Variable (x axis)


Reeza wrote:
And just a quick note, that if you're new to SAS and graphing, using SG procedures is a better way to go, in particular SGPLOT. The Graph procedures are limited and don't look as nice.

Yes, I agree with this, and furthermore, my opinion is that the SG procedures are easier to use as well. But I'm sure there are many instruction videos/manuals/books that still show SAS/GRAPH and PROC GCHART, these are still supported and can be used.

--
Paige Miller
Respected Advisor
Posts: 2,661

Re: Proc GCHART: Rotate Text for Categorical Variable (x axis)

Posted in reply to PaigeMiller

Adding

 

I have 30 years of experience with SAS/GRAPH and so I can come up with a lot of SAS/GRAPH plotting code in my sleep. Speed of coding is an advantage to me; and even though I did say I think SG is easier, I'm still learning it.

--
Paige Miller
Super User
Posts: 13,084

Re: Proc GCHART: Rotate Text for Categorical Variable (x axis)

Posted in reply to PaigeMiller

PaigeMiller wrote:

Adding

 

I have 30 years of experience with SAS/GRAPH and so I can come up with a lot of SAS/GRAPH plotting code in my sleep. Speed of coding is an advantage to me; and even though I did say I think SG is easier, I'm still learning it.


Quite agree @PaigeMiller and there are still things involving axis appearances, depending on the graph type, I haven't figured out with SG procedures that are available in the Axis statement. I will say I don't miss Symbol very much though and am really learning to love the ATTRMAP possibilities.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 261 views
  • 9 likes
  • 4 in conversation