Hello
I have a grouped barchart that I want to sort by the group variable. In the example below the graph starts with the lowest value on variable group (1949-1953) , but I want it to start with the highest value. Ie it should start with group 1959-1963. I have tried to use the discreteorder = data on the colaxis, but that option affects the values within each group. Is this possible?
I also want to have only ONE label on the reference line, in this case 3 labels are printed...
tks
jenny
/* ---------- Code ---------------------*/
proc format;
value sex
1 = 'Male'
2 = 'Female';
run;
proc format;
value group
1 = '1949-1953'
2 = '1954-1958'
3 = '1959-1963';
run;
data chartds;
medel = 150; group = 1; sex = 1;output;
medel = 180; group = 1; sex = 2;output;
medel = 200; group = 2; sex = 2;output;
medel = 100; group = 2; sex = 1;output;
medel = 80; group = 3; sex = 2;output;
medel = 130; group = 3; sex = 1;output;
run;
/* Order the data by group */
proc sort data = chartds;
by descending group;
run;
proc sgpanel data=chartds;
panelby group / layout=columnlattice
onepanel noborder novarname
colheaderpos=bottom;
vbar sex / response=medel group=sex;
rowaxis grid offsetmax=0.05 ;
colaxis display=none discreteorder=data ;
refline 110 /label=("Test refline") lineattrs=(pattern=2 thickness=2px color=black);
format sex sex. group group. ;label medel = 'eu/hour';
label group = "Age class";
keylegend /position=bottom title="Salary";
run;