Focal Point
[CLOSED] Create Scale

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

February 21, 2011, 05:01 PM
MMcDonald
[CLOSED] Create Scale
I am trying to create a scale that looks like the following:

| |
5% |------------55%-------------|75%
| |

I have 3 values low (5%), high (75%) and the the actual (55%) that I want to plot.
The actual should be in bold red and the rest is all in black.
Any ideas...?
Thanks

This message has been edited. Last edited by: Kerry,


8.0.9, Windows
excel / pdf
February 22, 2011, 03:13 PM
MMcDonald
OK - I figured out how to do this by joining 3 fields...the only problem I have is that I want the border and dashes to be black and the number to be red like below:
Scale Example
|---------93------|
|----45-----------|

I tried computing the fields and styling the columns and then concatenating them together with a compute but they loose the style.

does anyone have an idea how to style this?
Thanks


8.0.9, Windows
excel / pdf
February 22, 2011, 04:00 PM
<FreSte>
Are the number of dashes representing the scale (e.g. 20 dashes make 100) and do you want to have these numbers at the right position (50 in the middle) ??
... and what output is required ?

Can you post some example data; could be helpfull for better understanding

This message has been edited. Last edited by: <FreSte>,
February 22, 2011, 04:34 PM
FrankDutch
what is the required output format

are you thinking of an html or pdf format




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

February 22, 2011, 04:40 PM
MMcDonald
Its just a single value by a description....when the value comes in I do the following:

VALUE/F3=Value;
CODEA /A05 = FTOA (VALUE,'(F5)',CODEA);
CODEB /A5 = CODEA;
XDASH1/A4 = IF Value LT 10 THEN '----' ELSE '';
XDASH2/A4 = IF (Value FROM 10 TO 99) THEN '--' ELSE '';

-SET &XLN1=IF XVALUE EQ '1' THEN 'A3' ELSE
- IF XVALUE EQ '2' THEN 'A6' ELSE
- IF XVALUE EQ '3' THEN 'A9' ELSE
- IF XVALUE EQ '4' THEN 'A12' ELSE
- IF XVALUE EQ '5' THEN 'A15' ELSE
- IF XVALUE EQ '6' THEN 'A18' ELSE
- IF XVALUE EQ '7' THEN 'A21' ELSE
- IF XVALUE EQ '8' THEN 'A24' ELSE
- IF XVALUE EQ '9' THEN 'A27' ELSE 'A27';

-SET &XLN2=IF XVALUE EQ '9' THEN 'A3' ELSE
- IF XVALUE EQ '8' THEN 'A6' ELSE
- IF XVALUE EQ '7' THEN 'A9' ELSE
- IF XVALUE EQ '6' THEN 'A12' ELSE
- IF XVALUE EQ '5' THEN 'A15' ELSE
- IF XVALUE EQ '4' THEN 'A18' ELSE
- IF XVALUE EQ '3' THEN 'A21' ELSE
- IF XVALUE EQ '2' THEN 'A24' ELSE
- IF XVALUE EQ '1' THEN 'A27' ELSE 'A27';

XLINE1/&XLN1=IF XVALUE EQ '9' THEN '|--------------------------' ELSE
IF XVALUE EQ '8' THEN '|-----------------------' ELSE
IF XVALUE EQ '7' THEN '|--------------------' ELSE
IF XVALUE EQ '6' THEN '|-----------------' ELSE
IF XVALUE EQ '5' THEN '|--------------' ELSE
IF XVALUE EQ '4' THEN '|-----------' ELSE
IF XVALUE EQ '3' THEN '|--------' ELSE
IF XVALUE EQ '2' THEN '|-----' ELSE
IF XVALUE EQ '1' THEN '|--' ELSE '|--' ;

XLINE2/&XLN2=IF XVALUE EQ '9' THEN '--|' ELSE
IF XVALUE EQ '8' THEN '-----|' ELSE
IF XVALUE EQ '7' THEN '--------|' ELSE
IF XVALUE EQ '6' THEN '-----------|' ELSE
IF XVALUE EQ '5' THEN '--------------|' ELSE
IF XVALUE EQ '4' THEN '-----------------|' ELSE
IF XVALUE EQ '3' THEN '--------------------|' ELSE
IF XVALUE EQ '2' THEN '-----------------------|' ELSE
IF XVALUE EQ '1' THEN '--------------------------|' ELSE '--------------------------|';

CODEA /A05 = FTOA (VALUE,'(F5)',CODEA);
CODEB /A5 = CODEA;
CODEC /A150 = XLINE1||XDASH1||XDASH2||CODEB||'%'||XLINE2;


----*** the above code creates the following |--------113%-----| and the value is offset by the number of dashes I add on the let ofr right....It works fine I just need to change the Value to Red. Thanks


8.0.9, Windows
excel / pdf
February 22, 2011, 04:43 PM
MMcDonald
Frank - the output is a focexec report on an HTML page coreated in HTML Painter. I had to comment out "ON TABLE SET HTMLCSS ON" since it was destorting my scale...Thanks


8.0.9, Windows
excel / pdf
February 23, 2011, 04:24 AM
<FreSte>
Hi,

If the output is only HTML, you can do something like this:

DEFINE FILE CAR
  COLOR/A10 = 
    IF DEALER_COST LT 6000  THEN 'red'   ELSE
    IF DEALER_COST GT 10000 THEN 'green' ELSE 'purple';
  CCM/A100 = COUNTRY | ' - ' | '<span style="color:' | COLOR | ';">' | CAR | '</span>' | ' - ' | MODEL;
END

TABLE FILE CAR
  SUM DEALER_COST
  BY CCM
END


So in your example,

CODEB /A60 = '<span style="font-color:red;">' | CODEA | '%</span>' ;

This message has been edited. Last edited by: <FreSte>,
February 23, 2011, 04:15 PM
Waz
Here is something that may help or confuse.

TABLE FILE CAR
 SUM  
      COMPUTE PCT/P6.2 = PCT.DEALER_COST ;
      COMPUTE GRAPH/A500 = '<div style="width:120px;height:25px;position:relative;">'
                         | '<hr style="position:absolute;left:0px;height:20px;width:1px"/>'
                         | '<hr style="position:absolute;top:10px;height:1px;width:100px"/>'
                         | '<hr style="position:absolute;left:100px;height:20px;width:1px"/>'
                         | '<div style="position:absolute;background-color:white;left:' | PTOA(PCT, '(P3)','A3') | 'px">' | PTOA(PCT, '(P6.2%)','A7') | '</div>'
                         | '</div>' ;
 BY   COUNTRY
END


You will have to do a lot of adjustments, but the concept is there.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!