BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have a number of gcharts. I've placed the legend at the bottom center but this often leaves a large blank space on the page. Is there a way of moving the legend up against the chart?
4 REPLIES 4
GraphGuy
Meteorite | Level 14
With traditional SAS/Graph procs (such as gchart), you can use a legend statement, and specify mode=share and/or specify an offset= to move the legend from the default location.

For example, you could use a blank footnote statement to add the desired amount of white-space at the bottom of the page:

footnote1 height=5pct " ";

And then a legend statement something like the following untested pseudo-code...

legend1 mode=share position=(bottom middle) offset=(0,-5);
deleted_user
Not applicable
So there is no way to dynamically set this. It has to be set differently for each chart.

I have some 50 charts all of which are generated fairly dynamically so I don't need to change much over time. I need a way of setting this that does no require me to manually tweak each chart.
GraphGuy
Meteorite | Level 14
Are you saying the number of items in the legend varies (a lot) for each chart?

If the legend varies a lot for each chart, you might need to just let it auto-position for each one (if you manually tweak the legend, it can be hard to guarantee it will work with all graphs, if the number of items in the legend varies greatly).
Bill
Quartz | Level 8
Bill;

There's lots of good help in sashelp. Look for legend statement under SAS/GRAPH Statements

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1314 views
  • 0 likes
  • 3 in conversation