Focal Point
Hi iam new to WebFOCUS i have some problems in my Gauge Chart

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7271076551

February 23, 2006, 06:07 AM
kalyanswarna
Hi iam new to WebFOCUS i have some problems in my Gauge Chart
Hi iam new to WebFOCUS i have some problems in my Gauge Chart.
my requirement is i need to take the values of the chart from database.
and my approach is i have calculate the values and hold in some table.but iam not able to call these values as a Yaxis values.how can i call these values

This message has been edited. Last edited by: kalyanswarna,
February 23, 2006, 07:19 AM
Tony A
As a quick throw away answer (glad you decided to follow the previous links!) try

ON TABLE SAVE FORMAT ALPHA

This is because you are summing numeric values and when these are held (in a SAVE or HOLD) they will be held in internal formats (packed decimal or binary). Saving them in ALPHA format will ensure that they are hel as alphanumeric.



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
February 23, 2006, 07:35 AM
kalyanswarna
Hi, Tony
thanks for your reply
i tried with your suggestion(ON TABLE....)
but i didn't get the solution
it takes the same default values
is it possible or not
plz give me a reply

Thanks
February 23, 2006, 07:55 AM
Tony A
A little advice so that you can progress.

Put -SET &ECHO=ALL; at the top of your fex.
This will expand all the code into a comment section within your HTML output.
When your report (or graph) is produced, right click on the background (not the graph) to bring up the context menu and select "view source".
Look through this text file to establish where you need to place your -INCLUDE SAVE.



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
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
February 24, 2006, 07:53 AM
kalyanswarna
Thanks a Lot JG
I Have some Doubt.Please Clarify me,
is it possbile to Call the Gauge Band(Values) From DataBase.

Thanks
February 24, 2006, 08:16 AM
<JG>
Yes,
TABLE FILE XXX
PRINT COLUMN1 COLUMN2 COLUMN3
ON TABLE SAVE
END
-RUN
-READ SAVE &VAR1.An. &VAR2.An. &VAR2.An.

Where n is the DISPLAY length of the column.
February 26, 2006, 10:50 PM
kalyanswarna
Thanks JG.

This message has been edited. Last edited by: kalyanswarna,
February 27, 2006, 10:11 AM
<JG>
The issue is that you area reading the values as being 9 bytes 'Q1.A9.' but you create them as 12 bytes D12.2. Change the .A9. to .A12.