What is wrong with these annotates?

Reply
Occasional Contributor
Posts: 16

What is wrong with these annotates?

I want to draw a triangle with label A, B, C and point on it. But it does not output the results.

data triangle;

   length function style color $ 8 text $ 5;

   retain hsys xsys ysys "3";

  output;

   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;

   function='label';color='cx808080';x=50;y=90;size=35;position='3';style='calibri';text='A';textweight='normal';

   output;

   function='point';color='red';x=50;y=90;output;

run;

proc ganno annotate=triangle;

run;

quit;

Next, I am trying to draw a barchart using the data below.

data barchart;

input Category $2 score 3 color $8;

cards;

A 70 cxe35454

B 60 cx67549A

C 130 cx22ebe8

D 40 cx25eb22

E 90 cxe8eb22

;

run;

data barlabel;

   length color category Score style $ 8;

title "MinKhee's first bar chart";

axis1 label=none major=none minor=none style=0

      value=none;

axis2 label=none;

legend1 label=('Category') frame;

run;

quit;

proc gchart data=barchart;

vbar discrete category freq=score type=count

gaxis=axis1 raxis=axis2

legend=legend1;

run;

quit;

I am pretty slow in annotate, hope can teach me.

Super User
Posts: 9,682

Re: What is wrong with these annotates?

Post it at GRAPH forum. Robs is there.

Super User
Super User
Posts: 7,407

Re: What is wrong with these annotates?

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.

http://blogs.sas.com/content/graphicallyspeaking/

Super User
Posts: 17,868

Re: What is wrong with these annotates?

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.

Super User
Posts: 10,516

Re: What is wrong with these annotates?

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.

Ask a Question
Discussion stats
  • 4 replies
  • 253 views
  • 0 likes
  • 5 in conversation