BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
need_some_help
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

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

need_some_help
Calcite | Level 5

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!!!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1156 views
  • 1 like
  • 2 in conversation