1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
data essai4;
input annee cat3 $ var tx :nlpct. ;
tx2=tx/1000;
tx_fake=tx-0.15;
if tx_fake<0 then tx_fake=0;
if tx>0 then tx_label=tx;else tx_label=.;
cards;
2005 A 1 35,85%
2005 B 1 81,85%
2005 C 1 0,00%
2005 D 1 65,96%
2005 E 1 66,06%
2012 A 1 12,77%
2012 B 1 65,03%
2012 C 1 0,00%
2012 D 1 50,00%
2012 E 1 45,14%
2005 A 2 32,08%
2005 B 2 71,37%
2005 C 2 0,00%
2005 D 2 68,09%
2005 E 2 64,68%
2012 A 2 0,00%
2012 B 2 16,56%
2012 C 2 0,00%
2012 D 2 27,50%
2012 E 2 15,56%
;
proc template ;
define style lemien;
parent=styles.listing;
class GraphColors /
'gdata3' = cx7C95CA
'gdata4' = cxDE7E6F
'gdata5' = cx7C95CA
'gdata6' = cxDE7E6F ;
end;
run;
ods html style=lemien ;
ods graphics / noborder ;
proc sgpanel data=essai4;
panelby var/ layout=columnlattice onepanel noborder colheaderpos=bottom novarname;
hbar cat3 / response=tx2 group=annee stat=sum groupdisplay=cluster grouporder=ascending nostatlabel ;
hbar cat3 / response=tx group=annee stat=sum groupdisplay=cluster grouporder=descending nostatlabel nooutline name='a' ;
hbar cat3 / response=tx_fake group=annee stat=sum groupdisplay=cluster grouporder=descending nostatlabel nooutline name='a' datalabel=tx_label;
refline 0 / axis=x;
colaxis display=(nolabel) VALUES=(0 to 1 by 0.1) ;
rowaxis display=(nolabel noline noticks);
keylegend 'a' / noborder ;
run; |
Partager