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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1781 views
  • 0 likes
  • 2 in conversation