Data visualization with SAS programming

Major ticks in PROC GCHART

Reply
N/A
Posts: 0

Major ticks in PROC GCHART

Hi,
I am using PROC GCHART to create a vertical bar chart.
The problem is that the major ticks marks appear in the vertical axis but not in the horizontal axis.
I have tried to put in the axis definition the option major=(number=5), but the major ticks don't appear and in the log there is this message:

WARNING: The MAJOR= option on AXIS statement 22 was ignored because the Month axis does not support MAJOR=.

I'd like to know if it's possible to show the major ticks marks in a PROC GCHART (when i use the same axis define in a PROC GPLOT there's not problem), and if it's possible, how can i do it.

Thanks in advance,
Elena


Axis1 /*** vertical axis ***/
STYLE=1
WIDTH=1
MINOR=NONE
LABEL=( HEIGHT=9pt "" )
VALUE=(HEIGHT=9pt);

Axis2 /* horizontal */
STYLE=1
WIDTH=1
MINOR=NONE
major=(number=5)
LABEL=( HEIGHT=9pt "" )
VALUE=(HEIGHT=9pt);


PROC GCHART DATA=A;
VBAR MONTH /
DISCRETE
SUMVAR=Request
SUBGROUP=PRIORITY
SPACE=1
html=link
MISSING
FRAME TYPE=SUM
LEGEND=LEGEND1
COUTLINE=SAME
RAXIS=AXIS1
MAXIS=AXIS2;
RUN;
SAS Employee
Posts: 977

Re: Major ticks in PROC GCHART

Traditional sas/graph gcharts allow tickmarks on the response (height) axis, but not on the midpoint (bar) axis.

I guess the reasoning is something like ... if you have a bar & a bar value/label at every data point, why the need for tickmarks? Also, since the bars are at discrete/categorical values it wouldn't really make sense to have tickmarks (tickmarks are for proportionally-spaced numeric ranges).

If you *really* need tickmarks on the bar axis, you could annotate them (but that's a lot of work, and I'm not sure it really gains you anything).

---

Ok, so much for my soapbox! :-)

Here's the code to annotate tickmarks at each bar:

[pre]
data tick_anno; set sashelp.class;
xsys='2'; ysys='1';
function='move'; midpoint=name; y=0; output;
function='draw'; y=-.7; output;
run;

axis1 value=(angle=90);
proc gchart data=sashelp.class anno=tick_anno;
vbar name / type=sum sumvar=height descending maxis=axis1;
run;
[/pre]
N/A
Posts: 0

Re: Major ticks in PROC GCHART

Thank you so much!!!

I don't really need tickbars... but a client has asked me if it was possible to see the graphs with tickmarks, so i'm going to try annotating them.

Thanks and regards!
Elena
Ask a Question
Discussion stats
  • 2 replies
  • 189 views
  • 0 likes
  • 2 in conversation