85
CHAPTER 7: Advanced Features
Bar Chart (Histogram)
—¬GH<line width>;<x start>;<y start>;
<x-increment>;<y-increment>;<bar width>;<# of entries>; <value 1>; <value
2>; ...
Draws a bar chart. X,Y start specifies the bottom left-hand corner of the
first bar (the origin on the chart’s x,y scale). The x-increment specifies the
horizontal movement before the next bar is printed. The y-increment (in
n/300 inches) determines the height of the bar (multiplied by the value).
The bar width (in n/300 inches) specifies the width of the bar. Bar-chart
values can range from 0 to 3000. Each bar will have the color and/or
shading specified in the color/shading command. A maximum of 12 bars
can be printed in the same chart.
For example: ¬GS3;01;20;02;50;04;80
¬GH1;100;2400;300;1;100;3;500;600;800 draws three bars. If the attached
printer is a PCL color printer, the first bar will be blue, the second red, and
the third green. The bars will be shaded 20%, 50%, and 80% respectively,
as shown in Figure 7-15.
Figure 7-15. Bar chart (histogram).
x,y start
(100,2400)
x increment = horizontal distance
between values
Bar 1 ( value 500)
Color : Blue*
Shading 20%
Bar 2 ( value 600)
Color : Red*
Shading 50%
Bar 3 ( value 800)
Color : Green
Shading 80%
Height =
value times (*)
y increment
Line width
5mm