BookmarkSubscribeRSS Feed
magicdj
Fluorite | Level 6

if I have 50 products, and I will have 50 lines in the plot.

it won't show keylegend since it will take too much space.  if I want to show keylegend and want to put it in the next page, how should I do that? thanks.

 

 

* this is Example 4: Creating a Panel of Line Charts
* from SAS 9.4 ODS Graphics: Procedures Guide, Sixth
* Edition, SGPANEL Procedure. ;

proc sgpanel data=sashelp.prdsale;
  where product in ("CHAIR" "SOFA");
  title "Yearly Sales by Product";
  panelby year / spacing=5 novarname;
  vline month / response=actual group=product;
  title 'Default font size for keylegend';
run;
title;

proc sgpanel data=sashelp.prdsale;
  where product in ("CHAIR" "SOFA");
  title "Yearly Sales by Product";
  panelby year / spacing=5 novarname;
  vline month / response=actual group=product;
  keylegend / title="Product"
              titleattrs=(Size=14) 
              valueattrs=(Family=Arial Size=14);
  title 'TITLEATTRS= changes size of font for title of legend';
  title2 'VALUEATTRS= changes size of legend value labels';
run;
title;

 

1 REPLY 1
ballardw
Super User

You can use the ODS Graphics statement to make the space available to graph images bigger.

You say "next page". Which ODS destination are you using? Almost any approach with "pages" requires knowing the file type.

 

ODS Graphics/ height=12in;

would set the image to be 12 inches high which may allow your keylegend to fit. Additional width may also help.

 

I have to say the idea of 50 lines on a single plot tends to make me cringe in general.

 

If you are not actually going to print your result, only need electronic files, then you may also want to play with the PAPERSIZE option to allow for additional addressable space by the ODS Graphics settings.

sas-innovate-2024.png

📢

ANNOUNCEMENT

The early bird rate has been extended! Register by March 18 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

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
  • 1 reply
  • 320 views
  • 0 likes
  • 2 in conversation