Click here to see the SAS code.
Click here to see the example.

---------------------------------------------------------------

SAS/Graph imitation/enhancement of ...

   http://zedgraph.org/wiki/index.php?title=Step_Chart_Demo

-----

Traditional SAS/Graph gplot supports shaded areas, but it only 
shades the areas from the line down to the bottom of the graph
(or from the line down to the previous line/area).  It does not
have an option for shading the area between the line and the 
zero axis :\

Therefore, you have to take your y-value, and then create 3
series to plot (to fake gplot into looking like it's shading 
the area between the line and the zero axis).  One of the 
series is for the colored area above the zero line, another
is for the shaded area below the zero line, and another 
series is for the white/background area below the area
below he zero line.

It's a little confusing, and the order in which you do things
is *very* important! (The order you plot/overlay the lines, 
the order of the symbol and pattern statements, etc).

But hopefully this is a small/simple/generic enough example
that you can easily re-use it with your own data, without 
having to think too much about how the code actually works!

If you *do* want to understand the code, try doing the 
individual area plots 1 at a time, rather than overlaying them,
and you will gain a lot of insight into what's happening.
Also, read the gplot doc on the areas= option, to learn the 
subtleties about how the areas are overlaid & shaded.

Back to Samples Index