BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
master_jiang
Calcite | Level 5

When using font Times New Roman to display legend label, the subscript 3 cannot be displayed. If I change to other font such as "Monotype Sans WT J", the subscript can display. Does anyone know how to display subscript in DISCRETELEGEND in TNR font ? Many thanks!

 

Following is the SAS code and the test dataset is also attached

/*--------------------------------------------------------------------------------*/

ods path work.templates(update) sashelp.tmplmst(read) sasuser.templat(update);
proc template;
define style test/store=templates;
parent = Styles.rtf ;
class graphwalls /
frameborder=off;
class fonts / 'TitleFont' = ("Times New Roman, Times Roman, Times", 10pt ,Bold ) 'TitleFont2' = ("Times New Roman, Times Roman, Times", 10pt ,Bold ) 'footFont' = ("Times New Roman, Times Roman, Times", 10pt ) 'StrongFont' = ("Times New Roman, Times Roman, Times", 10pt,Bold) 'EmphasisFont' = ("Times New Roman, Times Roman, Times", 10pt,Italic) 'headingEmphasisFont' = ("Times New Roman, Times Roman, Times", 10pt,Bold) 'headingFont' = ("Times New Roman, Times Roman, Times", 10pt,Bold) 'docFont' = ("Times New Roman, Times Roman, Times",10pt) 'FixedEmphasisFont' = ("Times New Roman, Times Roman, Times", 10pt) 'FixedStrongFont' = ("Times New Roman, Times Roman, Times", 10pt,Bold) 'FixedHeadingFont' = ("Times New Roman, Times Roman, Times", 10pt,Bold) 'BatchFixedFont' = ("Times New Roman, Times Roman, Times", 10pt) 'FixedFont' = ("Times New Roman, Times Roman, Times", 10pt) ;
class color_list / 'link'= blue 'bgH' = white 'bgT' = white 'bgD' = white 'fg' = black 'bg' = white ;
style Table from Output / rules = groups cellpadding = 1px cellspacing = 0 bordercolor = lightgrey frame=hsides ;
class systemtitle / protectspecialchars=OFF asis=ON ;
class systemfooter / font=Fonts('footFont') protectspecialchars=OFF asis=ON ;
class text / 'continued' = " " ;
class continued / pretext=text('continued') width=_undef_ frame=void rules=none borderspacing = 0 padding = 0 ;
class header / protectspecialchars=off ;
class data / protectspecialchars=off ;
class rowheader / protectspecialchars=off ;
class usertext / protectspecialchars=off ;
class byline / protectspecialchars=off ;

style graphfonts from graphfonts / "graphdatafont" =("TIMES NEW ROMAN",10pt)
"graphlabelfont" =("TIMES NEW ROMAN",10pt,Bold)
"graphfootnotefont"=("TIMES NEW ROMAN",10pt)
"graphvaluefont" =("TIMES NEW ROMAN",10pt)
"graphtitlefont" =("TIMES NEW ROMAN",12pt,Bold)
"graphunicodefont"=("TIMES NEW ROMAN",10pt);
end;
define style intexttable;
parent=styles.rtf;
style TableHeaderContainer from TableHeaderContainer / bordertopwidth=6 bordertopcolor=red borderbottomwidth=12 borderbottomcolor=blue borderbottomstyle=dotted;
style TableFooterContainer from TableFooterContainer / bordertopwidth=6 bordertopcolor=red bordertopstyle=double;
style table from table / cellspacing=0 rules=groups frame=void;
style Table from Output / rules = none cellpadding = 1px cellspacing = 0 bordercolor = lightgrey frame=hsides asis=ON ;
class systemtitle / protectspecialchars=OFF asis=ON ;
class systemfooter / font=Fonts('footFont') protectspecialchars=OFF asis=ON ;
class text / 'continued' = " " ;
class continued / pretext=text('continued') width=_undef_ frame=void rules=none borderspacing = 0 padding = 0 ;
end;
run;

 

 

proc template;
define statgraph aebar;
begingraph/collation=binary subpixel=on designwidth=9.5 in designheight=6.5 in attrpriority=NONE
;
entrytitle halign=left textattrs=GraphTitleText(color=black weight=bold size=10pt)
"Adverse Events";
layout overlay/
xaxisopts=(label=" ")
yaxisopts=( display= ALL LabelPosition=CENTER label="% of Subjects" labelFitPolicy=Split type=LINEAR linearopts=( tickvaluelist=( 0 20 40 60 80 100 ) viewmax=100 ) );
;
barchart x=text y=prop/group=actarmcd groupdisplay=cluster name="arm";
discretelegend "arm"/across=1 valign=top halign=right location=inside;
endlayout;
endgraph;
end;

run;

 


proc sgrender data=test template=aebar;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Use the "Times New Roman Uni" font.That should work for you.

View solution in original post

2 REPLIES 2
DanH_sas
SAS Super FREQ

Use the "Times New Roman Uni" font.That should work for you.

master_jiang
Calcite | Level 5
It works!! Thank you so much!!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 635 views
  • 0 likes
  • 2 in conversation