You can place images
on the bars in two-dimensional bar charts generated by the GCHART
HBAR or VBAR statements. You can also place images on the bars of
three-dimensional bar charts if you are using the ACTIVEX or the
ACTXIMG device.
On the IMAGE= option
of the PATTERN statement, specify either the path to the image file
in quotation marks or a fileref that has been defined to point to
the image file.
pattern image=fileref | "external-image-file";
By default, the image
is tiled on the bar, which means that the image is copied as many
times as needed to fill each bar. Specify IMAGESTYLE=FIT in the PATTERN
statement to stretch the image as needed to fill each bar.
pattern image="external-image-file"
imagestyle=fit;
To tile subsequent images,
reset the PATTERN statement or by specify IMAGESTYLE=TILE.
Note: Images are supported on bar
charts generated by the HBAR and VBAR statements. If an image is specified
on a PATTERN statement that is used with another type of chart, then
the PATTERN statement is ignored and default pattern rotation is affected.
If you submit a PIE statement when an image has been specified in
the PATTERN= option, the default fill pattern is used for the pie
slices. Each pie slice displays the same fill pattern.
The following example
places an image on the bars of a vertical bar chart:
goptions reset=all htitle=1.25 colors=(yellow cxde7d6f);
title "Projected Automobile Sales";
data sales;
input Month Amount;
informat month monyy.;
datalines;
jan08 200
feb08 145
mar08 220
apr08 180
may08 155
jun08 250
;
proc sort;
by month;
pattern1 image="external-image-file";
proc gchart;
format month monname8.;
vbar month / discrete freq=amount inside=freq
coutline=black;
run;
quit;
The image is tiled to
fill each bar.
If the PATTERN IMAGESTYLE=FIT
option is used, the image is stretched to fill each bar.
pattern=fileref | "external-image-file" imagestyle=fit;