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] Dynamic titles - or should it be LABELS - on graphs

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Dynamic titles - or should it be LABELS - on graphs
 Login/Join
 
Master
posted
I'm really just starting with graphs Red Face after all these years and I'm sure there has to be a simpler way to accomplish something like this:



My code is here, but it is surely very clumsy and difficult to maintain. What I want is for only the years I select to be calculated and show in the graph labels at the bottom. So if my user selects only 2010 and 2012 I want only the label and colour for those years to be displayed at the bottom, not the labels and colours for all the hard-coded years - don't want to hard-code the years in the first place of course.

DEFINE FILE NEWORDER
MONTH/M=BLDATE;
2005QTY/D12 MISSING ON=IF BL_YEAR EQ 2005 THEN PQTY ELSE MISSING;
2006QTY/D12 MISSING ON=IF BL_YEAR EQ 2006 THEN PQTY ELSE MISSING;
2007QTY/D12 MISSING ON=IF BL_YEAR EQ 2007 THEN PQTY ELSE MISSING;
2008QTY/D12 MISSING ON=IF BL_YEAR EQ 2008 THEN PQTY ELSE MISSING;
2009QTY/D12 MISSING ON=IF BL_YEAR EQ 2009 THEN PQTY ELSE MISSING;
2010QTY/D12 MISSING ON=IF BL_YEAR EQ 2010 THEN PQTY ELSE MISSING;
2011QTY/D12 MISSING ON=IF BL_YEAR EQ 2011 THEN PQTY ELSE MISSING;
2012QTY/D12 MISSING ON=IF BL_YEAR EQ 2012 THEN PQTY ELSE MISSING;
2013QTY/D12 MISSING ON=IF BL_YEAR EQ 2013 THEN PQTY ELSE MISSING;
2014QTY/D12 MISSING ON=IF BL_YEAR EQ 2014 THEN PQTY ELSE MISSING;
2015QTY/D12 MISSING ON=IF BL_YEAR EQ 2015 THEN PQTY ELSE MISSING;
2016QTY/D12 MISSING ON=IF BL_YEAR EQ 2016 THEN PQTY ELSE MISSING;
2017QTY/D12 MISSING ON=IF BL_YEAR EQ 2017 THEN PQTY ELSE MISSING;
2018QTY/D12 MISSING ON=IF BL_YEAR EQ 2018 THEN PQTY ELSE MISSING;
2019QTY/D12 MISSING ON=IF BL_YEAR EQ 2019 THEN PQTY ELSE MISSING;
2020QTY/D12 MISSING ON=IF BL_YEAR EQ 2020 THEN PQTY ELSE MISSING;
YEAR/A4=EDIT(BL_YEAR);
END

GRAPH FILE NEWORDER
SUM NEWORDER.PRODUCTS.2005QTY AS '2005' NEWORDER.PRODUCTS.2006QTY AS '2006' NEWORDER.PRODUCTS.2007QTY 
AS '2007' NEWORDER.PRODUCTS.2008QTY AS '2008' NEWORDER.PRODUCTS.2009QTY 
AS '2009' NEWORDER.PRODUCTS.2010QTY AS '2010' NEWORDER.PRODUCTS.2011QTY 
AS '2011' NEWORDER.PRODUCTS.2012QTY AS '2012' NEWORDER.PRODUCTS.2013QTY 
AS '2013' NEWORDER.PRODUCTS.2014QTY AS '2014' NEWORDER.PRODUCTS.2015QTY 
AS '2015' NEWORDER.PRODUCTS.2016QTY AS '2016' NEWORDER.PRODUCTS.2017QTY 
AS '2017' NEWORDER.PRODUCTS.2018QTY AS '2018' NEWORDER.PRODUCTS.2019QTY 
AS '2019' NEWORDER.PRODUCTS.2020QTY AS '2020' 
ACROSS NEWORDER.ROOT_SEG.MONTH 
HEADING
"Product sales for successive years across month"
FOOTING
"This graph runs from the file &FOCFEXNAME"
WHERE DEPT EQ 'D' AND PDESC EQ 'SNOWTEX 45' AND BL_YEAR EQ 2012 OR 2013 OR 2014;
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID OFF
ON GRAPH PCHOLD FORMAT PDF
ON GRAPH SET GRAPHSTYLE *
setFillColor(getLegendArea(),new Color(221,255,255));
setMarkerDisplay(false);
setConnectLineMarkers(true);
setConnectScatterMarkers(true);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(2);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,2);
setAxisAssignment(1,0);
setSeriesType(1,2);
setAxisAssignment(2,0);
setSeriesType(2,2);
setAxisAssignment(3,0);
setSeriesType(3,2);
setAxisAssignment(4,0);
setSeriesType(4,2);
setAxisAssignment(5,0);
setSeriesType(5,2);
setAxisAssignment(6,0);
setSeriesType(6,2);
setAxisAssignment(7,0);
setSeriesType(7,2);
setAxisAssignment(8,0);
setSeriesType(8,2);
setAxisAssignment(9,0);
setSeriesType(9,2);
setAxisAssignment(10,0);
setSeriesType(10,2);
setAxisAssignment(11,0);
setSeriesType(11,2);
setAxisAssignment(12,0);
setSeriesType(12,2);
setAxisAssignment(13,0);
setSeriesType(13,2);
setAxisAssignment(14,0);
setSeriesType(14,2);
setAxisAssignment(15,0);
setSeriesType(15,2);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(2);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setTextJustHoriz(getO1Title(),1);
setFontSizeAbsolute(getO1Title(),true);
setFontSize(getO1Title(),12);
setFontStyle(getO1Title(),0);
setTextRotation(getO1Title(),0);
setTextWrap(getO1Title(),false);
setTextJustHoriz(getO1Label(),1);
setTextRotation(getO1Label(),0);
setTextWrap(getO1Label(),false);
setPlaceResize(getO1Title(),0);
setPlaceRotate(getO1Title(),0);
setPlaceAlign(getO1Title(),0);
setPlaceWordWrap(getO1Title(),0);
setPlaceResize(getO1Label(),0);
setPlaceRotate(getO1Label(),0);
setPlaceAlign(getO1Label(),0);
setPlaceWordWrap(getO1Label(),0);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
$
TYPE=REPORT,
     COLOR=RGB(225 225 225),
     BACKCOLOR=RGB(221 255 255),
$
TYPE=DATA,
     ACROSSCOLUMN=N1,
     COLOR='AQUA',
     BACKCOLOR='SILVER',
$
TYPE=DATA,
     ACROSSCOLUMN=N2,
     COLOR=RGB(255 255 136),
     BACKCOLOR='SILVER',
$
TYPE=DATA,
     ACROSSCOLUMN=N3,
     COLOR=RGB(55 255 55),
     BACKCOLOR='SILVER',
$
TYPE=DATA,
     ACROSSCOLUMN=N4,
     COLOR=RGB(232 0 0),
     BACKCOLOR='SILVER',
$
TYPE=DATA,
     ACROSSCOLUMN=N9,
     COLOR='FUCHSIA',
     BACKCOLOR=RGB(221 255 255),
$
TYPE=HEADING,
     LINE=1,
     JUSTIFY=CENTER,
$
TYPE=HEADING,
     LINE=1,
     OBJECT=TEXT,
     ITEM=1,
     FONT='ARIAL',
     COLOR='BLACK',
$
TYPE=FOOTING,
     LINE=1,
     JUSTIFY=CENTER,
$
TYPE=FOOTING,
     LINE=1,
     OBJECT=TEXT,
     ITEM=1,
     FONT='ARIAL',
     SIZE=8,
     COLOR='BLACK',
$
ENDSTYLE
END

This message has been edited. Last edited by: George Patton,


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Virtuoso
posted Hide Post
Using this code will help you but using the GUI could be better. You have to try every single options until you find the one you need.
setTextString(getTitle(),"&TITLE");
setDisplay(getTitle(),true);

setTextString(getSubtitle(),"&SUBTITLE");
setDisplay(getSubtitle(),true);

setTextString(getFootnote(),"&FOOTNOTE");
setDisplay(getFootnote(),true);
setFontStyle(getFootnote(),0);
setFontSizeAbsolute(getFootnote(),true);
setFontSizeInPoints(getFootnote(),8);
setPlaceResize(getFootnote(),0);


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Master
posted Hide Post
Martin, Thanks for the suggestions and I'll look them up. But I think my whole paradigm is wrong, not just the issue of the titles. It seems dumb to have to hard-code all the defines and the subsequent individual graph values with a separate AS phrase for each.

If this were a TABLE request it would be dead simple:
TABLE FILE NEWORDER
SUM PQTY
BY BL_YEAR
ACROSS MONTH
WHERE BL_YEAR EQ 2013 OR 2014
END
but getting anywhere near that simplicity in a graph is eluding me.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Expert
posted Hide Post
George,

Warm your head my friend, you're suffering from brain freeze and looking too deep -

Try this ...
GRAPH FILE NEWORDER
SUM NEWORDER.PRODUCTS.PQTY
BY BL_YEAR 
ACROSS NEWORDER.ROOT_SEG.MONTH
WHERE ......
ON GRAPH SET GRMERGE ON

In fact, just like your table request with GRMERGE Wink


T



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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Master
posted Hide Post
Brillant Tony !! I knew there had to be a better way.

Thanks ! Cool Smiler


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report 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] Dynamic titles - or should it be LABELS - on graphs

Copyright © 1996-2020 Information Builders