BookmarkSubscribeRSS Feed
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
Hello all;
I am wondering if there is a "simple" way to "split" a legend marker so that:
Jan07/MD=x/RN=x
becomes

Jan07
MD=x
RN=x

I see the split function is available for other SAS graphing capabilities, just not SGPLOT.

I have been poking around all the documentation for SGPLOT and Xaxis and not find much except for the graphics template language, which I am not ready to dive into just yet.


Much thanks!

Lawrence
4 REPLIES 4
DanH_sas
SAS Super FREQ
Currently, there is not a way to create the SPLITCHAR functionality using the SG procedures. There is a technique you can use in GTL to create this effect. Let me know if you are interested.
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
Dan;
Rats! Would be interested in knowing more about GTL.
I have seen a couple of examples online so I will look there too.
Thanks.

Lawrence
DanH_sas
SAS Super FREQ
Here is a GTL example from a colleague that demonstrates how to create a "splitchar" axis. The keys here are splitting the text in the datastep, turning off the axis tick values, and using a blockplot to render the text.

proc template;
define statgraph tickvaluewrap;
begingraph ;
layout lattice / column=1 rowgutter=0 rowweights=(.85 .15)
columndatarange=union;
columnaxes;
columnaxis / offsetmin=.11 offsetmax=.11 display=none;
endcolumaxes;
barchart x=question y=answer / ;
blockplot x=question block=line / class=n display=(values) valuehalign=center;
endlayout;
endgraph;
end;
run;

data survey;
length line $20;
input Answer Question $3-70;
n=1;
line= scan(question,n,"~");
do while( lengthn(line) > 0 );
output;
n+1; answer=.;
line= scan(question,n,"~");
end;
datalines;
3 #1~How do you~feel today?
4 #2~Would you be~willing to try this~again?
2 #3~Is there some~way to get there~from here?
5 #4~When do you~think this will~be finished,~today?
run;

proc sgrender data=survey template=tickvaluewrap;
run;
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
Dan;
I'll take a look. Thanks for sharing this.
~Lawrence

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
  • 1033 views
  • 0 likes
  • 2 in conversation