Desktop productivity for business analysts and programmers

rows and columns in gchart legend

Accepted Solution Solved
Reply
Contributor
Posts: 56
Accepted Solution

rows and columns in gchart legend

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


Accepted Solutions
Solution
‎09-17-2011 10:42 AM
SAS Super FREQ
Posts: 8,720

Re: rows and columns in gchart legend

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


All Replies
Solution
‎09-17-2011 10:42 AM
SAS Super FREQ
Posts: 8,720

Re: rows and columns in gchart legend

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

Contributor
Posts: 56

rows and columns in gchart legend

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

☑ This topic is SOLVED.

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

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