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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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