08-24-2015 05:20 AM
I want to draw a triangle with label A, B, C and point on it. But it does not output the results.
length function style color $ 8 text $ 5;
retain hsys xsys ysys "3";
function="move"; x=50; y=90; output;
function="draw"; x=90; y=20; size=2; line=0.5;color="cx808080"; output;
function="draw"; x=10; y=20; output;
function="draw"; x=50; y=90; output;
proc ganno annotate=triangle;
Next, I am trying to draw a barchart using the data below.
input Category $2 score 3 color $8;
A 70 cxe35454
B 60 cx67549A
C 130 cx22ebe8
D 40 cx25eb22
E 90 cxe8eb22
length color category Score style $ 8;
title "MinKhee's first bar chart";
axis1 label=none major=none minor=none style=0
legend1 label=('Category') frame;
proc gchart data=barchart;
vbar discrete category freq=score type=count
I am pretty slow in annotate, hope can teach me.
08-24-2015 08:21 AM
My suggestion would be to look at more modern techniques, using sgplot and Graph Template Language. These replace the old graphing techniques. If you have a look through Sanjay's excellent blog on Graphs, SGPLOT and GTL you will find examples of pretty much anything you can think of, you may need to combine some of the code to get exactly what you want.
08-24-2015 11:02 AM
What are you using to program? It works fine for me on SAS 9.3 BASE with ODS Listing as my default output.
At least the annotate part does, the graph doesn't but it generates a lot of errors so you can start by debugging those.
08-24-2015 01:13 PM
AXIS, LEGEND, SYMBOL and PATTERN statements do not belong inside a DATA step.
I'm not sure what your BARLABEL data set is supposed to do, but it would have terminated, with 1 observation with all blank values when encountering the AXIS statement.