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

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.

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
  • 4 replies
  • 975 views
  • 0 likes
  • 3 in conversation