09-16-2014 05:05 AM
I have some problems with Proc Gchart.
As you see in the attached graph, the biggest bars are at the top of the graph but I rather want the biggest bars at the bottom of the graph
For example, I want the orange bar to be at the bottom of the graph, does anyone know how I can manage to do that?
I have created the graph in enterprise guide, but I’ll attach the code that generates the graph and hopefully someone can solve my problem with code.
CREATE VIEW WORK.SORTTempTableSorted AS
SELECT T.AAA, T.Arb_Totalt_red
FROM WORK.QUERY_FOR_VECKOARBETSTID_HE_0000 as T
PATTERN7 COLOR = _STYLE_;
PATTERN8 COLOR = _STYLE_;
PATTERN9 COLOR = _STYLE_;
PATTERN10 COLOR = _STYLE_;
PATTERN11 COLOR = _STYLE_;
PATTERN12 COLOR = _STYLE_;
POSITION = (MIDDLE RIGHT OUTSIDE)
LABEL=( " ")
LABEL=( " ")
PROC GCHART DATA=WORK.SORTTempTableSorted
09-16-2014 05:15 AM
TBH I don't really use GChart as now using sgplot or GTL, so not sure how useful my response will be here. What I think you would need to do is to explicitly set YAXIS values to be (40, 35, 30, 25, 20...) i.e. in reverse. Not sure how you would do it in GChart but below is some syntax for sgplot:
yaxis label="Label" values=(40,35,30,25,20,15,10,5,0);
To add, the SAS help on SGPLOT:
09-16-2014 10:24 AM
Generally the approach would be to sort or order the data by an appropriate variable the first group seen is on the bottom. The values in this case look like all you need is to either use an ORDER BY Arb_Totalt_red clause in your SQL.
Often I end up adding a variable to represent a final order after seeing the first version of the chart to do the sort.