Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     SOLVED - conditional styling on graph bars

Read-Only Read-Only Topic
Go
Search
Notify
Tools
SOLVED - conditional styling on graph bars
 Login/Join
 
Platinum Member
posted
In this example sales GE 20000 should be green and sales LT 20000 should be red.
It works with a BY but not with an ACROSS. The ACROSS is needed to order the graph bars.

TABLE FILE CAR
SUM SALES
BY CAR
ON TABLE HOLD
END
TABLE FILE HOLD
BY HIGHEST SALES NOPRINT
BY CAR
ON TABLE SAVE AS MYORDER
END
-RUN
-SET &HOWMANY = &LINES;
-SET &KOUNTER = 0;
GRAPH FILE CAR
SUM SALES
ACROSS CAR
COLUMNS
-REPEAT end.loop &HOWMANY TIMES
-SET &KOUNTER = &KOUNTER +1 ;
-READ MYORDER NOCLOSE &CAR.A16
-SET &THING = IF &KOUNTER NE &HOWMANY THEN '''' | &CAR || '''' | ' AND '
-ELSE '''' | &CAR | '''' ;
&THING.EVAL
-end.loop
END

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


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report This Post
Expert
posted Hide Post
Where's your styling??? Compute a flag with NOPRINT and use it in styling with WHEN=...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Platinum Member
posted Hide Post
Tom - the style sheet returns an error when this is done with the ACROSS.

(FOC3202) BAD VALUE IN STYLESHEET FILE AT LINE 29: MACRO=CONDITION_1
0 NUMBER OF RECORDS IN GRAPH= 18 PLOT POINTS= 10


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report This Post
Expert
posted Hide Post
Spence,

Take out the macro! Post the code, between the code tags </>

Never mind, here's a working example:

  
TABLE FILE CAR
SUM SALES 
BY CAR
ON TABLE HOLD
END
TABLE FILE HOLD
BY HIGHEST SALES NOPRINT
BY CAR
ON TABLE SAVE AS MYORDER
END
-RUN
-SET &HOWMANY = &LINES;
-SET &KOUNTER = 0;
GRAPH FILE CAR
SUM SALES
   COMPUTE FLAG/A1 = IF SALES GE 20000 THEN 'Y' ELSE 'N'; NOPRINT
ACROSS CAR
COLUMNS
-REPEAT end.loop &HOWMANY TIMES
-SET &KOUNTER = &KOUNTER +1 ;
-READ MYORDER NOCLOSE &CAR.A16
-SET &THING = IF &KOUNTER NE &HOWMANY THEN '''' | &CAR || '''' | ' AND '
-ELSE '''' | &CAR | '''' ;
&THING.EVAL
-end.loop
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET HAXIS 720
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH PCHOLD FORMAT JPEG
ON GRAPH SET STYLE *
TYPE = REPORT,  FONT=VERDANA, SIZE=9, $
TYPE = HEADING, FONT=VERDANA, SIZE=10, STYLE=BOLD, $
TYPE=DATA, ACROSSCOLUMN=N1, COLOR=GREEN, WHEN=FLAG EQ 'Y',$
TYPE=DATA, ACROSSCOLUMN=N1, COLOR=RED,   WHEN=FLAG EQ 'N',$

ENDSTYLE
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setFontName(getDataText(),"Verdana");
setDepthAngle(65);
setPieDepth(45);
restoreAllSlices();
setPieFeelerTextDisplay(2);
setPieTilt(25);
setPieLabelDisplay(0);
setDisplay(getPieLabel(),true);
setLegendAutomatic(false);
setFontStyle(getLegendText(),2);
setFontStyle(getPieSliceLabel(),2);
setTextFormatPreset(getPieSliceLabel(),5);
setFontSizeInPoints(getTitle(),12);
setFontSizeAbsolute(getPieSliceLabel(),true);
setFontSizeInPoints(getPieSliceLabel(),8);
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),9);
setTextFormatPattern(getDataText(),"$#,###,###,###.##");
setFontSizeInPoints(getO1Label(),9);
setFontSizeInPoints(getY1Label(),9);
setFontSize(getDataText(),10);
setFontSizeAbsolute(getTitle(),true);
setFontSizeInPoints(getTitle(),12);
setLegendMarkerPosition(0);
setTransparentBorderColor(getChartBackground(),true);
setRect(getPieFrame(), new Rectangle(-15500,-13500,27000,27000));
setRect(getFrame(), new Rectangle(-10400,-10000,25000,30000));
setTextString(getTitle(),"TOTAL RETAIL COST BY COUNTRY");
ENDSTYLE
END
-RUN
-EXIT


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Platinum Member
posted Hide Post
Thanks Tom.

I did not have ACROSSCOLUMN in style sheet, just COLUMN.

TABLE FILE CAR
SUM SALES
BY CAR
ON TABLE HOLD
END
TABLE FILE HOLD
BY HIGHEST SALES NOPRINT
BY CAR
ON TABLE SAVE AS MYORDER
END
-RUN
-SET &HOWMANY = &LINES;
-SET &KOUNTER = 0;
GRAPH FILE CAR
SUM SALES
ACROSS CAR
COLUMNS
-REPEAT end.loop &HOWMANY TIMES
-SET &KOUNTER = &KOUNTER +1 ;
-READ MYORDER NOCLOSE &CAR.A16
-SET &THING = IF &KOUNTER NE &HOWMANY THEN '''' | &CAR || '''' | ' AND '
-ELSE '''' | &CAR | '''' ;
&THING.EVAL
-end.loop
ON GRAPH SET STYLE *
TYPE=DATA, ACROSSCOLUMN=SALES, COLOR=RGB(255 0 0), WHEN=SALES LT 8000, $
TYPE=DATA, ACROSSCOLUMN=SALES, COLOR=RGB(0 128 0), WHEN=SALES GE 8000, $
ENDSTYLE
END


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     SOLVED - conditional styling on graph bars

Copyright © 1996-2020 Information Builders