My code is DISPLAYCLIPPED=true, but why WARNING display it? My code as below
MPRINT(FIGURE): proc template;
MPRINT(FIGURE): define statgraph linechart;
MPRINT(FIGURE): begingraph/ border=false;
MPRINT(FIGURE): discreteattrmap name="l" / ignorecase=true ;
MPRINT(FIGURE): value "xx1" / lineattrs=(color=green pattern=solid );
MPRINT(FIGURE): value "xx2" / lineattrs=(color=blue pattern=solid );
MPRINT(FIGURE): value "xx3" / lineattrs=(color=red pattern=solid );
MPRINT(FIGURE): value "xx4" / lineattrs=(color=green pattern=solid );
MPRINT(FIGURE): value "xx5" / lineattrs=(color=blue pattern=solid );
MPRINT(FIGURE): value "xx6" / lineattrs=(color=red pattern=solid );
MPRINT(FIGURE): value "xx7" / lineattrs=(color=yellow pattern=solid );
MPRINT(FIGURE): value "xx8" / lineattrs=(color=BROWN pattern=solid );
MPRINT(FIGURE): value "xx9" / lineattrs=(color=MAGENTA pattern=solid );
MPRINT(FIGURE): enddiscreteattrmap ;
MPRINT(FIGURE): discreteattrvar attrvar=visit2 var=visit attrmap="l" ;
MPRINT(FIGURE): discreteattrmap name="s" / ignorecase=true ;
MPRINT(FIGURE): value "A" / markerattrs=(color=black symbol=Circle);
MPRINT(FIGURE): value "B" / markerattrs=(color=black symbol=CircleFilled);
MPRINT(FIGURE): enddiscreteattrmap ;
MPRINT(FIGURE): discreteattrvar attrvar=abpmfl2 var=abpmfl attrmap="s" ;
MPRINT(FIGURE): legendItem type=line name="xx1" / lineattrs=(color=green pattern=solid thickness=2) label="xx1";
MPRINT(FIGURE): legendItem type=line name="xx2" / lineattrs=(color=blue pattern=solid thickness=2) label="xx2";
MPRINT(FIGURE): legendItem type=line name="xx3" / lineattrs=(color=red pattern=solid thickness=2) label="xx3";
MPRINT(FIGURE): legendItem type=marker name="A" / markerattrs=(color=black symbol=Circle) label="Awake hours(9:00 AM - 9:00
PM)";
MPRINT(FIGURE): legendItem type=marker name="B" / markerattrs=(color=black symbol=CircleFilled) label="Sleep hours(1:00 AM -
6:00 AM)";
MPRINT(FIGURE): layout globallegend / border=true;
MPRINT(FIGURE): discretelegend "xx1" "xx2" "xx3" "xx4" "xx5" "xx6" "xx7" "xx8" "xx9" "A" "B" /autoitemsize=false DISPLAYCLIPPED=true across=2;
MPRINT(FIGURE): endlayout;
MPRINT(FIGURE): entrytitle "aaaa";
MPRINT(FIGURE): layout lattice/ columns = 1 rows = 3 rowweights=uniform rowdatarange=union columndatarange=union
rowgutter=0.5 columngutter=0.5 skipemptycells=true pad=(left=40);
MPRINT(FIGURE): rowaxes;
MPRINT(FIGURE): rowaxis/type=linear display=(line ticks tickvalues) linearopts=(tickvaluesequence=(start=50 end=200
increment=50) viewmin=50 viewmax=200);
MPRINT(FIGURE): rowaxis/type=linear display=(line ticks tickvalues) linearopts=(tickvaluesequence=(start=50 end=200
increment=50) viewmin=50 viewmax=200);
MPRINT(FIGURE): rowaxis/type=linear display=(line ticks tickvalues) linearopts=(tickvaluesequence=(start=50 end=200
increment=50) viewmin=50 viewmax=200);
MPRINT(FIGURE): endrowaxes;
MPRINT(FIGURE): columnaxes;
MPRINT(FIGURE): columnaxis/type=linear display=(line ticks tickvalues) linearopts=(tickvaluelist=(0 6 12 18 24) viewmin=-1
viewmax=25);
MPRINT(FIGURE): endcolumnaxes;
MPRINT(FIGURE): drawtext textattrs=(color=black size=10pt weight=bold) "ABPM"/
anchor=BOTTOM width=80 widthunit=percent ROTATE=90 x=5 y=50 justify=center ;
MPRINT(FIGURE): cell;
MPRINT(FIGURE): layout overlay;
MPRINT(FIGURE): drawtext textattrs=(color=black size=10pt weight=bold) "PL0010001"/ anchor=topright width=25
widthunit=percent xspace=wallpercent yspace=wallpercent x=80 y=80 justify=center ;
MPRINT(FIGURE): seriesplot x=x1 y=y1 / name="linechart" display=(markers) group=visit2 lineattrs=(thickness=2 pattern=Solid);
MPRINT(FIGURE): scatterplot x=x1 y=y1 / name="scatter" group=abpmfl2;
MPRINT(FIGURE): endlayout;
MPRINT(FIGURE): endcell;
MPRINT(FIGURE): cell;
MPRINT(FIGURE): layout overlay;
MPRINT(FIGURE): drawtext textattrs=(color=black size=10pt weight=bold) "PL0010002"/ anchor=topright width=25
widthunit=percent xspace=wallpercent yspace=wallpercent x=80 y=80 justify=center ;
MPRINT(FIGURE): seriesplot x=x2 y=y2 / name="linechart" display=(markers) group=visit2 lineattrs=(thickness=2 pattern=Solid);
MPRINT(FIGURE): scatterplot x=x2 y=y2 / name="scatter" group=abpmfl2;
MPRINT(FIGURE): endlayout;
MPRINT(FIGURE): endcell;
MPRINT(FIGURE): cell;
MPRINT(FIGURE): layout overlay;
MPRINT(FIGURE): drawtext textattrs=(color=black size=10pt weight=bold) "PL0040003"/ anchor=topright width=25
widthunit=percent xspace=wallpercent yspace=wallpercent x=80 y=80 justify=center ;
MPRINT(FIGURE): seriesplot x=x3 y=y3 / name="linechart" display=(markers) group=visit2 lineattrs=(thickness=2 pattern=Solid);
MPRINT(FIGURE): scatterplot x=x3 y=y3 / name="scatter" group=abpmfl2;
MPRINT(FIGURE): endlayout;
MPRINT(FIGURE): endcell;
MPRINT(FIGURE): SIDEBAR / ALIGN=bottom;
MPRINT(FIGURE): ENTRY "Hours" ;
MPRINT(FIGURE): ENDSIDEBAR;
MPRINT(FIGURE): endlayout;
MPRINT(FIGURE): endgraph;
MPRINT(FIGURE): end;
NOTE: STATGRAPH 'Linechart' has been saved to: WORK.TEMPLAT
NOTE: PROCEDURE TEMPLATE used (Total process time):
real time 0.04 seconds
cpu time 0.04 seconds
MPRINT(FIGURE): run;
MPRINT(FIGURE): proc sgrender data=b template=linechart;
MPRINT(FIGURE): run;
NOTE: Compressing data set WORK._DOCTMP000000000000000000000 decreased size by 57.14 percent.
Compressed is 3 pages; un-compressed would require 7 pages.
WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
NOTE: There were 305 observations read from the data set WORK.B.
NOTE: PROCEDURE SGRENDER used (Total process time):
real time 2.34 seconds
cpu time 0.71 seconds
I finally know why. This is caused by insufficient width
I finally know why. This is caused by insufficient width
proc sgrender data=b template=linechart;
run;
%end;
%end;
%end;
%mend;
%figure;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.