February 23, 2006, 06:36 PM
<JG>As far as I know setScaleArray is not a valid API call and will never work.
Nor will the method you are using to create the array even if it were a valid call.
An array is always comma delimited with double quotes for text elements.
It is not possible to set the scale tick interval via the method that you want to use.
You can set the minimum and maximum values and the interval for the grid/ticks. However
they are always relative to zero.
So if you set min to 15 and max to 55 with a step of 10 your grid/ticks are 15,20,30,40,50,55.
You cannot set ticks individually.
With a gauge graph you can set bands and these respect the steps, however at the moment it appears
that the BandnLabel functionality does not work so you have no ability to apply custom numbers.
The best option is a band based graph having no ticks and a legend relating colours to ranges generated using annotations.
In this case the –INCLUDE method is not viable so a HOLD FORMAT ALPHA and a
-READ should be used to generate the variables.
It is possible to make the coordinates of the annotations variables based on the range and values but the calculation required to make them dynamic is not worth the effort.
Look at the following based on the car file.
SET HOLDLIST = PRINTONLY
-SET &L1=15;
-SET &L2=25;
-SET &L3=35;
-SET &L4=45;
-SET &L5=55;
GRAPH FILE CAR
SUM MPG
ACROSS MODEL
WHERE COUNTRY EQ 'FRANCE'
ON GRAPH SET LOOKGRAPH GAUGE1
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH SET GRAPHSTYLE *
setGraphType(110);
setGaugeMajorAutoStep(false);
setGaugeMinorAutoStep(false);
setScaleFromZero(false);
setDisplay(getGaugeLabel(),false);
setDisplay(getGaugeMajorTick(),false);
setDisplay(getGaugeMinorTick(),false);
setY1ScaleMin(15.0);
setY1ScaleMax(55.0);
setGaugeBandMin(getGaugeBand1(), &L1);
setGaugeBandMax(getGaugeBand1(), &L2);
setGaugeBandMin(getGaugeBand2(), &L2);
setGaugeBandMax(getGaugeBand2(), &L3);
setGaugeBandMin(getGaugeBand3(), &L3);
setGaugeBandMax(getGaugeBand3(), &L4);
setGaugeBandMin(getGaugeBand4(), &L4);
setGaugeBandMax(getGaugeBand4(), &L5);
setBorderColor(getGaugeBand1(),new Color(0,0,0));
setBorderColor(getGaugeBand2(),new Color(0,0,0));
setBorderColor(getGaugeBand3(),new Color(0,0,0));
setBorderColor(getGaugeBand4(),new Color(0,0,0));
setFillColor(getGaugeBand1(),new Color(255,0,0));
setFillColor(getGaugeBand2(),new Color(255,255,0));
setFillColor(getGaugeBand3(),new Color(250,200,0));
setFillColor(getGaugeBand4(),new Color(0,255,0));
setDisplay(getAnnotationBox(0), true);
setDisplay(getAnnotation(0), true);
setTextString(getAnnotation(0), "&L1 - &L2");
setFillColor(getAnnotation(0), new Color (0,0,0));
setFontSize(getAnnotation(0),6);
setFontStyle(getAnnotation(0), 0);
setFillColor(getAnnotationBox(0), new Color(255,0,0));
setTransparentBorderColor(getAnnotationBox(0), false);
setRect(getAnnotation(0), new Rectangle (-1700, -6800, 3700,1200));
setDisplay(getAnnotationBox(1), true);
setDisplay(getAnnotation(1), true);
setTextString(getAnnotation(1), "&L2 - &L3");
setFillColor(getAnnotation(1), new Color (0,0,0));
setFontSize(getAnnotation(1),6);
setFontStyle(getAnnotation(1), 0);
setFillColor(getAnnotationBox(1), new Color(255,255,0));
setTransparentBorderColor(getAnnotationBox(1), false);
setRect(getAnnotation(1), new Rectangle (-1700, -8000, 3700,1200));
setDisplay(getAnnotationBox(2), true);
setDisplay(getAnnotation(2), true);
setTextString(getAnnotation(2), "&L3 - &L4");
setFillColor(getAnnotation(2), new Color (0,0,0));
setFontSize(getAnnotation(2),6);
setFontStyle(getAnnotation(2), 0);
setFillColor(getAnnotationBox(2), new Color(255,220,0));
setTransparentBorderColor(getAnnotationBox(2), false);
setRect(getAnnotation(2), new Rectangle (-1700, -9200, 3700,1200));
setDisplay(getAnnotationBox(3), true);
setDisplay(getAnnotation(3), true);
setTextString(getAnnotation(3), "&L4 - &L5");
setFillColor(getAnnotation(3), new Color (0,0,0));
setFontSize(getAnnotation(3),6);
setFontStyle(getAnnotation(3), 0);
setFillColor(getAnnotationBox(3), new Color(0,255,0));
setTransparentBorderColor(getAnnotationBox(3), false);
setRect(getAnnotation(3), new Rectangle (-1700, -10400, 3700,1200));
setPlace(false);
ENDSTYLE
ON GRAPH PCHOLD FORMAT PNG
END