Click here to see the SAS code.
Click here to see the example.
This is a little 'trick' you can use to produce a bar chart, with
multiple lines overlaid.
Normally you would use 'proc gchart' to do a bar chart (but that
would only do a bar chart with no lines).
Or, in v9 sas 'proc gbarline' was added, but that only allowed
one line to be overlaid with a bar (coming in v9.2 gbarline
supports multiple lines).
In this trick/example, I use 'proc gplot' to do the lines, and
also what 'looks' like bars. The bars are actually gplot lines,
using the 'needle' interpolation, and a very thick width.
One note of interest - a gplot line with markers allows you to
use the 'html=' to add charttip/flyover-text info, but the
needle interpolation (for the bars) has no marker, and sas
does not allow html= charttips on the line segments (which is
actually what the bar is). Therefore, when I create the
charttips for the line markers, I go ahead and add the
charttip info for *all* the lines & bars (product1-product5, and
also total calls) at that x-coordinate to all the markers.
I annotate pictograms on the left & right axes, in addition to
having axis label text. Also, on the left axis label, I add a
colored box (using the 'U' character of the 'marker' font)
to reinforce that this axis is for the colored bars.
Additionally, I use a split left/right title to label the
axes in yet another way.
Back to Samples Index