GKPI Procedure

Example 5: Defining a Speedometer with Reversed Colors

Features:

PROC GKPI statement option: MODE=BASIC

SPEEDOMETER statement options:
COLORS=
LABEL=
Sample library member: GKPSPCLR
Speedometer with default colors in reverse order

Program

goptions reset=all device=javaimg xpixels=210 ypixels=200;
proc gkpi mode=basic;
speedometer actual=12 bounds=(0 25 50 100) /
   colors=(cx84AF5B cxF1DC63 cxD06959)
   label="Cancellations";
run; 
quit;

Program Description

Set the graphics environment.The XPIXELS and YPIXELS graphics options reduce the size of the graphics output area and, therefore, reduce both the size of the KPI chart and the distance between the label and the KPI chart. These options scale the KPI charts to a size that would be appropriate for use in a dashboard.
goptions reset=all device=javaimg xpixels=210 ypixels=200;
Generate the KPI chart. Specify the range boundaries, actual KPI value, target value, and colors. The green, yellow, and red colors listed in GKPI Procedure Default Colors are specified in reverse order so that green begins at zero.
proc gkpi mode=basic;
speedometer actual=12 bounds=(0 25 50 100) /
   colors=(cx84AF5B cxF1DC63 cxD06959)
   label="Cancellations";
run; 
End the procedure. The GKPI procedure supports RUN-group processing, so it is recommended that you enter the QUIT statement to end the procedure.
quit;