I'm making a 100% Stacked Bar Chart with an axistable below it (to avoid labeling the bars which gets messy). By default, the order of the two are opposing; the bar chart puts the lower number on the bottom while the axistable puts the lower number on top. I was hoping to be able to reorder the axis table by reversing the Y axis for that table, but unfortunately don't seem to be able to (I'm guessing the axistable isn't even using the Y axis, for obvious reasons). I figured out two workarounds, but neither is optimal for my particular usage. One is to reverse the Y axis on the *barchart*, which does make the two match; but I prefer lower numbers on bottom. The second is to sort the dataset by the two variables but descending the second variable; in combination with reversing the Y axis on the barchart, this makes it look correct as long as I have the same categories exactly for each bar, which my data should. However, that sort itself is undesirable for the effects it has on my other charts, and I can't afford to re-sort the data twice for every set of charts as I'm making a few hundred thousand slides in total. Is there a way to reverse the axistable, or am I stuck with one of the workarounds above (or a different/better one?) The below code shows my example and a couple of workarounds. proc template; define statgraph test; dynamic pctval; begingraph/datacolors=(cxFF0000 cx00FF00 cx0000FF cxFFFF00 cxFF00FF cx00FFFF cxBBBBBB cx555555) datacontrastcolors=(cxFF0000 cx00FF00 cx0000FF cxFFFF00 cxFF00FF cx00FFFF cxBBBBBB cx555555); layout lattice/columnweights=preferred rowweights=preferred columndatarange=union columns=1 ; layout overlay/ /*yaxisopts=(reverse=1)*/ xaxisopts=(display=none); *WORKAROUND 1 and 2 - uncomment yaxisopts; barchart x=sex y=pctval/group=age; endlayout; layout overlay / walldisplay=none xaxisopts=( display=none griddisplay=off offsetmin=.1 offsetmax=.1) yaxisopts=(display=(tickvalues) offsetmin=.2 offsetmax=0 reverse=1) ; AxisTable x=sex value=pctval/ class="age" colorGroup=age Display=(Label); endlayout; endlayout; endgraph; end; quit; proc tabulate data=sashelp.class; where age le 15; class sex age; tables sex,age*rowpctn; ods output table=classpct(keep=sex age pct:); run; /* WORKAROUND 2 - uncomment this sort. proc sort data=classpct; by sex descending age ; run; */ proc sgrender data=classpct template=test; dynamic pctval='pctn_10'; run; Thanks!
... View more