/**********************************************************************/ /**********************************************************************/ title 'Vertical Bar Chart Title #1'; title2 'Vertical Bar Chart Title#2'; footnote1 'Vertical Bar Chart Footnote #1'; footnote2 'Vertical Bar Chart Footnote #2'; pattern v=s c=green r=999; proc gchart data=sasuser.crime(where=(state lt 20)); vbar state/ sumvar=murder discrete name='vertbar'; run; quit; /**********************************************************************/ init: call notify('graph','_set_graph_','work.gseg.vertbar.grseg'); return; graph: call notify('graph','_get_info_',infoid); spotid=getnitemn(infoid,'spotid'); spottype=getnitemn(infoid,'spottype'); text=getnitemc(infoid,'text'); return; /**********************************************************************/ init: submit continue; proc sort data=sasuser.crime(where=(state lt 20)) out=crimsort; by state; run; goptions goutmode=replace nodisplay; title 'Vertical Bar Chart Title #1'; title2 'Vertical Bar Chart Title #2'; footnote1 'Vertical Bar Chart Footnote #1'; footnote2 'Vertical Bar Chart Footnote #2'; pattern v=s c=green r=999; proc gchart data=sasuser.crime(where=(state lt 20)); vbar state/ sumvar=murder discrete name='vertbar'; run; quit; goptions goutmode=append display; endsubmit; call notify('graph','_set_graph_','work.gseg.vertbar.grseg'); return; graph: call notify('graph','_get_info_',infoid); spotid=getnitemn(infoid,'spotid'); spottype=getnitemn(infoid,'spottype'); text=getnitemc(infoid,'text'); if spottype=26 then do; dsid=open('work.crimsort'); recnum=spotid-4; * since the first bar starts @5; rc=fetchobs(dsid,recnum); midpoint=getvarn(dsid,varnum(dsid,'state')); sumval=getvarn(dsid,varnum(dsid,'murder')); dsid=close(dsid); end; else do; midpoint=_blank_; sumval=_blank_; end; return; /**********************************************************************/ init: submit continue; proc sort data=sasuser.houses out=housort; by bedrooms; run; proc means data=housort noprint; var price; by bedrooms; output out=sumdata sum=pricesum; run; goptions goutmode=replace nodisplay; title 'Vertical Bar Chart Title #1'; title2 'Vertical Bar Chart Title #2'; footnote1 'Vertical Bar Chart Footnote #1'; footnote2 'Vertical Bar Chart Footnote #2'; pattern v=s c=green r=999; proc gchart data=sasuser.houses; vbar bedrooms/ sumvar=price discrete name='vertbar'; run; quit; goptions goutmode=append display; endsubmit; call notify('graph','_set_graph_','work.gseg.vertbar.grseg'); return; graph: call notify('graph','_get_info_',infoid); spotid=getnitemn(infoid,'spotid'); spottype=getnitemn(infoid,'spottype'); text=getnitemc(infoid,'text'); if spottype=26 then do; dsid=open('work.sumdata'); recnum=spotid-4; * since the first bar starts @5; rc=fetchobs(dsid,recnum); midpoint=getvarn(dsid,varnum(dsid,'bedrooms')); sumval=getvarn(dsid,varnum(dsid,'pricesum')); numobs=getvarn(dsid,varnum(dsid,'_freq_')); dsid=close(dsid); end; else do; midpoint=_blank_; sumval=_blank_; numobs=_blank_; end; return; /**********************************************************************/ newid=open('sasuser.houses'); poplist=makelist(); whrc=where(newid,'bedrooms='||midpoint); do while(fetch(newid)=0); rc=insertc(poplist,getvarc(newid,varnum(newid,'street')),-1); end; newid=close(newid); refresh; rc=popmenu(poplist); poplist=dellist(poplist); /**********************************************************************/ /**********************************************************************/