그래픽 템플릿 언어를 사용하여 차트에 마커를 표시하려고합니다. 스타일에 마커 정의를 추가하려고 시도했습니다. markerattrs=
옵션 문 내의 seriesplot 문과 차트 그룹에 discreteattrmaps를 사용했습니다. 나는이 접근법들 중 어느 것도 작동시키지 못하는 것 같습니다.GTL을 사용하여 시리즈 차트에 마커 표시
스타일 정의 : 차트
proc template;
define style excel;
parent=styles.htmlblue;
class graph /attrpriority='none';
style graphdata1/contrastColor=#416FA6;
style graphdata2/contrastColor=#A8423F;
style graphdata3/contrastColor=#86A44A;
style graphdata4/contrastColor=#8064A2;
style graphdata5/contrastColor=#DA8137;
style graphdata6/contrastColor=#D7E4BD;
style graphdata7/contrastColor=#FCD5B5;
style graphdata8/contrastColor=#8EA5CB;
style graphdata9/contrastColor=#E6B9B8;
style graphdata10/contrastColor=#CCC1DA;
end;
run;
템플릿 :
proc template;
define statgraph excel_series_trended;
dynamic _date _class _metric _title;
begingraph;
entrytitle halign=center _title;
discreteattrmap name="symbols"/ignorecase=true ;
value "IBM"/markerattrs=(color=blue symbol=diamondfilled) ;
value other/markerattrs=(color=red symbol=circlefilled) ;
enddiscreteattrmap ;
discreteattrvar attrvar=groupmarkers var=stock attrmap="symbols" ;
layout lattice/rowdatarange=data columndatarange=data rowgutter=0 columngutter=0;
layout overlay/walldisplay=(fill)
yaxisopts=(griddisplay=on gridattrs=(pattern=2 color=Cx999999) linearopts=(viewmin=0))
xaxisopts=(type=discrete );
seriesplot x=_date y=_metric/group=_class markercolorgroup=_class name='series' groupdisplay=overlay connectorder=xaxis lineattrs=(pattern=solid thickness=3);
endlayout;
sidebar/align=bottom spacefill=false;
discretelegend 'series'/opaque=true border=false halign=center valign=center displayclipped=true order=rowmajor;
endsidebar;
endlayout;
endgraph;
end;
run;
는 sashelp.stocks
데이터 집합을 사용하여 차트를 렌더링 :
ods html style=excel;
ods graphics/antialias=on antialiasmax=999999;
proc sgrender data=sashelp.stocks template=excel_series_trended;
where date between '01jan2005'd and '01jun2005'd;
dynamic _date="date" _metric="high" _class="stock";
run;
가, (나도 대답을 리콜하지 않았로) 나는이 문제를 해결하는 방법은'sgplot'을 실행하는 데이었고, 'tmplout' 옵션을 사용하여 SGPLOT이 어떤 일을하는지보십시오. – Joe
감사합니다. 나는 sgplot에 익숙하지 않고 그 옵션이 있다는 것을 깨닫지 못했습니다. 알아 둘만한. –
그래, SGPLOT이 쉽게 해낸 GTL에서 뭔가를하는 방법을 알아 내는데 어려움을 겪어왔다. SGPANEL에는 비슷한 옵션이 없다는 것은 짜증나게합니다. – Joe