Hi!
In my Vbar chart I have a legend with a lot of entries, the most appropriate place for it is under the chart (with the same width as chart - fit page). So it is shown there but there is a little problem - values are listed first from left to right and then from top to bottom ('rows-filling') and I need them to go first from top to bottom and then from left to right ('columns-filling'). I've tried to use Accross= and Down= options but it didn't help. I've also got known about rowmajor | colmajor - but I don't know how to use them correctly (there are no examples at all....). Does anyone have any ideas?
P.S.
To avoid misunderstanding:
HAVE NEED
name1 name2 name3 name1 name3 name5
name4 name5 name6 name2 name4 name6
Hi:
ROWMAJOR or COLMAJOR will do what you want. They are single word options that go in your LEGEND statement. For example:
legend1 frame shape=symbol(14pt,12pt)
label=(f="Albany AMT/bold" height=12pt 'COLMAJOR: ')
colmajor /* ~~ or change this line to ROWMAJOR */
down=2
position=(bottom center outside);
Then, you will need to link the LEGEND statement of your choice with the LEGEND= option in your PLOT or VBAR action statement.
proc gchart data=testgrp;
title 'VBAR with COLMAJOR';
vbar var1/ sumvar=var2 type=mean
subgroup=var3
legend=legend1;
run;
quit;
You may need to edit the code created by Enterprise Guide in order to specify ROWMAJOR or COLMAJOR -- I don't have a good memory of the task or wizard selections to tell you whether it's there or not.
cynthia
Hi:
ROWMAJOR or COLMAJOR will do what you want. They are single word options that go in your LEGEND statement. For example:
legend1 frame shape=symbol(14pt,12pt)
label=(f="Albany AMT/bold" height=12pt 'COLMAJOR: ')
colmajor /* ~~ or change this line to ROWMAJOR */
down=2
position=(bottom center outside);
Then, you will need to link the LEGEND statement of your choice with the LEGEND= option in your PLOT or VBAR action statement.
proc gchart data=testgrp;
title 'VBAR with COLMAJOR';
vbar var1/ sumvar=var2 type=mean
subgroup=var3
legend=legend1;
run;
quit;
You may need to edit the code created by Enterprise Guide in order to specify ROWMAJOR or COLMAJOR -- I don't have a good memory of the task or wizard selections to tell you whether it's there or not.
cynthia
Cynthia, many thaks! I didn't expected that is so simple. And with value option I can specify the order I need. So I can change my legend in any way! Thanks!!!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.