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

When using gchart to draw bar charts, it is very difficult to get 
very small/narrow bars, and to pack them in very densely.

Therefore I came up with this little "trick" where I use gplot 
line segments to "simulate" very narrow tightly-packed bars.

For each bar (or, in this case, each segment of a bar) I output 
2 coordinates of a gplot line segment (one at the beginning, and
one at the end), and then I output a sas "missing" value (this is
the '.' value).  Basically, here is the code ...

   intr=(intrtime)/100;
   nice=(intrtime+nicetime)/100;
   sys=(intrtime+nicetime+systime)/100;
   usr=(intrtime+nicetime+systime+usrtime)/100;

   yintr=0;    ynice=intr; ysys=nice;  yusr=sys;  output;
   yintr=intr; ynice=nice; ysys=sys;   yusr=usr;  output;
   yintr=.;    ynice=.;    ysys=.;     yusr=.;    output;

And then I plot it using gplot, something like the following ...

   symbol1  color=yellow v=none interpol=join w=.5 l=1;
   symbol2  color=green  v=none interpol=join w=.5 l=1;
   symbol3  color=blue   v=none interpol=join w=.5 l=1;
   symbol4  color=red    v=none interpol=join w=.5 l=1;

   plot (yintr ynice ysys yusr) * datetime / overlay

The advantage is that you can pack a *lot* of information into 
a single chart.  The disadvantage is that you can't do html= 
charttips and drilldown on line segments (whereas you can do
it on real gchart bar charts).

Back to Samples Index