Click here to see the SAS code.
Click here to see the SAS code. (old style code)
Click here to see the example.
Animated graphs -- always a crowd pleaser! :)
This is another chart I originally wrote as part of my research in
grad-school. In that original version, I was only producing a gif
animation, and the user had to view it using some software such as
'xanim'. In this new version, I use html tags, and the output
can be viewed using a web browser, which is more convenient.
Basically, this is an hbar chart, and to get 1/2 of the bars to go
to the left of the "middle axis" I make those values negative.
I then use a user-defined format (proc format) to make the negative
values show up without the negative sign :)
I hardcode all the y-axis agegroup labels, and I annotate the word
'Male' and 'Female' so users will know that the blue bars represent
males, and the pink bars represent females.
I use the 'autoref' option to draw reference lines at each major
tickmark (this helps you see whether the bars are growing or
shrinking during the animation).
I use several goptions to control the animation - the most important
ones are "iteration=5" (which makes it run through the animation 5
times - you probably don't want to make your animations repeat an
infinite number of times, because that can consume lots of cpu),
and the "delay=75" (that controls the speed of the animation).
Look up the doc on "gifanim" for more info!
Back to Samples Index