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!!!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.