Data visualization with SAS programming

help needed with legends disapeared when using proc sgpanel to generate stacked bar chart

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

help needed with legends disapeared when using proc sgpanel to generate stacked bar chart

I used proc sgpanel to generate stacked bar charts, the legend didn't show in graph, I think, it maybe due to too many PIDs (about 20).

here is the code, so how can I force SAS to print legend in the graph .

 

ods graphics on;

proc sgpanel data=allo1_20b;
  title 'Top 20 Taxon by patient, ';
 panelby pid / layout=columnlattice novarname noborder colheaderpos=bottom;
  vbar visit1 / response=rab_a group=genus dataskin=gloss grouporder=data ;
  colaxis display=(nolabel);
  rowaxis grid;
keylegend / title="Type" position=right across=1;
  format visit1 vs.;
  run;


Accepted Solutions
Solution
‎04-18-2018 01:06 PM
SAS Super FREQ
Posts: 1,265

Re: help needed with legends disapeared when using proc sgpanel to generate stacked bar chart

If you have too many groups, try increasing the LEGENDAREAMAX on ODS GRAPHICS statement.

http://go.documentation.sas.com/?docsetId=odsug&docsetTarget=p0kroq43yu0lspn16hk1u4c65lti.htm&docset...

 

View solution in original post


All Replies
PROC Star
Posts: 1,190

Re: help needed with legends disapeared when using proc sgpanel to generate stacked bar chart

Can you post your data or some of it? 

 

And what your plot looks like now?

Occasional Contributor
Posts: 6

Re: help needed with legends disapeared when using proc sgpanel to generate stacked bar chart

[ Edited ]

here are dataset and the output graph without legend, thank you!

Solution
‎04-18-2018 01:06 PM
SAS Super FREQ
Posts: 1,265

Re: help needed with legends disapeared when using proc sgpanel to generate stacked bar chart

If you have too many groups, try increasing the LEGENDAREAMAX on ODS GRAPHICS statement.

http://go.documentation.sas.com/?docsetId=odsug&docsetTarget=p0kroq43yu0lspn16hk1u4c65lti.htm&docset...

 

Occasional Contributor
Posts: 6

Re: help needed with legends disapeared when using proc sgpanel to generate stacked bar chart

Posted in reply to Sanjay_SAS
thank you, Sanjay_SAS, it worked!
☑ This topic is solved.

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

Discussion stats
  • 4 replies
  • 110 views
  • 1 like
  • 3 in conversation