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     [CODE] Multiple fields in Bar Chart Titles

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CODE] Multiple fields in Bar Chart Titles
 Login/Join
 
Expert
posted
Actually, it's not so cold up here in Dearborn that I need to be thawed out. But, my WebFOCUS Graph seems to need a bit of thawing on this one.

What I'm looking for is a way to have the "TITLEs" in a bar graph to appear (under each BAR) the same way that "TITLEs" in a report appear (above each data column). The catch is that the sort BY field in the graph is a concatenation of multiple fields AND each one of the concatenated fields must appear on its own line.

The below code simulates what I need although it done in the below code as a TABLE FILE request (which is not an acceptable solution).

Hopefully, there's someting for GRAPH TITLEs similar to the use of the comma in the TABLE FILE request.

The thing is: I don't know what that is, Do You?

Here's my sample code:
SET ACROSSPRT = COMPRESS
DEFINE FILE CAR
CRLF/A1 = HEXBYT(126,CRLF) ;
SORTLINE/A132 = COUNTRY || CRLF || CAR || CRLF || MODEL ;
CNTR/I1 WITH MODEL = CNTR + 1 ;
END
-RUN
GRAPH FILE CAR
SUM CAR.BODY.DEALER_COST AS ''
BY HIGHEST CAR.BODY.DEALER_COST NOPRINT
BY CAR.CARREC.SORTLINE AS ''
WHERE RECORDLIMIT EQ 6
ON GRAPH SET LOOKGRAPH VBAR
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 VAXIS 250
ON GRAPH SET HAXIS 750
ON GRAPH SET GRMERGE ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(3);
setTextFormatPreset(getPieSliceLabel(),2);
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);
setTextRotation(getO1Title(),0);
setTextWrap(getO1Title(),false);
setTextJustHoriz(getO1Label(),0);
setFontSizeAbsolute(getO1Label(),true);
setFontSize(getO1Label(),8);
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 *
     SQUEEZE=ON, ORIENTATION=PORTRAIT,$
TYPE=REPORT,
GRID=OFF, FONT='TIMES NEW ROMAN', SIZE=10, COLOR=RGB(224 224 224), BACKCOLOR='NONE',$
ENDSTYLE
END
-RUN
TABLE FILE CAR
PRINT COUNTRY AS ''
 OVER CAR AS ''
 OVER MODEL AS ''
BY CRLF AS ''
ACROSS CNTR NOPRINT
WHERE RECORDLIMIT EQ 6
FOOTING
"NOTE: This simulates the way that I want the values of SORTLINE"
"to appear,one set of items under each bar."
ON TABLE SET PAGE OFF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
GRID=OFF, JUSTIFY=CENTER,$
TYPE=DATA, FONT=ARIAL, SIZE=9, JUSTIFY=CENTER,$
TYPE=FOOTING, FONT=ARIAL, SIZE=9, JUSTIFY=LEFT,$
ENDSTYLE
END

Thanks a Gig, in advance...




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
setLabelStagger(getO1Label(),true);


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

Change your defines to -
DEFINE FILE CAR
  CRLF/A2 = '\n';
  SORTLINE/A160 = COUNTRY || CRLF || CAR || CRLF || MODEL ;

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
Expert
posted Hide Post
quote:
CRLF/A2 = '\n';


Good One


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
Thanks, two great answers from two great guys.

However, there's still some issues with the following code, they are:
1) The data lines are "clipped" only the first one or two lines and the top half of the 3rd are visible. Frowner
2) The stagger is not acceptable to the user Frowner
3) Without the stagger: not all items are displayed Frowner
DEFINE FILE CAR
SORTLINE/A132 = COUNTRY || '\n' || MODEL || '\n' || CAR || '\n' || EDIT(MODEL,'99999999999999') || '\n' || CAR ;
END
-RUN
GRAPH FILE CAR
SUM CAR.BODY.DEALER_COST AS ''
BY HIGHEST CAR.BODY.DEALER_COST NOPRINT
BY CAR.CARREC.SORTLINE AS ''
WHERE RECORDLIMIT EQ 10
ON GRAPH SET LOOKGRAPH VBAR
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 VAXIS 300.000
ON GRAPH SET HAXIS 960.000
ON GRAPH SET UNITS PIXELS
ON GRAPH SET GRMERGE ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setLabelStagger(getO1Label(),true);
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(0);
setPlaceWordWrap(getO1Label(),1);
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),6);
setPieFeelerTextDisplay(1);
setPieLabelDisplay(3);
setTextFormatPreset(getPieSliceLabel(),2);
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setTextJustHoriz(getO1Title(),1);
setFontSizeAbsolute(getO1Title(),true);
setFontSize(getO1Title(),12);
setTextRotation(getO1Title(),0);
setTextWrap(getO1Title(),false);
setTextJustHoriz(getO1Label(),1);
setFontSizeAbsolute(getO1Label(),true);
setFontSize(getO1Label(),8);
setFillColor(getO1Label(),new Color(0,0,0));
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 *
SQUEEZE=ON, ORIENTATION=PORTRAIT,$
TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=10, COLOR=RGB(224 224 224),$
TYPE=DATA, COLUMN=N3, COLOR='SILVER',$
ENDSTYLE
END
-* Copy and run this code to see what I mean.
-* With and without the stagger
So, what next? ( I don't want to open a case Music )
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
Hey Doug,

This works; Probably need to play with these lines, but, it works. Too much info though; titles overlap sometimes...

- must have setPlace = false:

setPlace(FALSE);

setO1LabelMargin(15);

setRect(getFrame(), new Rectangle(-13100,-10999,29000,25000));

setTextString(getO1Title()," ");
setDisplay(getO1Title(),true);
setTextString(getY1Title()," ");
setDisplay(getY1Title(),true);

setRiserWidth(50);

hth


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
I don't think you'll like this but I got something to work with your code by:

1. Making the bars wider (HAXIS)
2. Turning the stagger off.
3. Making the font very small: setFontSize(getO1Label(),4);

I have a sneaking suspicion your users won't like that either but maybe it will give you more ideas.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
Thanks Ginny, And, You're right... They don't like 1 or 3. Stagger off would be nice...

I heading towards adding a TABLE FILE request, below the GRAPH, which will display the concatenated fields (SORTLINE) and their values...

I'll post the final / acceptable code...

I'm still open to other suggestions... Music - Not forgetting to "breath whilst I wait"...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
I was going to suggest that. A friend of mine did that here for a graph and it was very effective. You can make it a compound and it will look nicely integrated.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
That's how I would normally do it, together with the values in a data grid. Suits all recipients as some prefer to look at graphics, others at numbers. Giving them both means that all tastes are counted for.

I also persuade them to have it in a PDF document so that I can use pixel perfect.

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
Expert
posted Hide Post
Something like this -

This is one graph from 14 across four pages of statistics. Each page is labelled to identify what the graphs contain.

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
Expert
posted Hide Post
quote:
...as some prefer to look at graphics, others at numbers.
Left Brain / Right Brain... It's good to please them all and often required... I'm perfecting it based on all this great input...

Thanks for everything...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
I'll post me initial results after I get to FTP the image to my site. Is there a way to embed an image another way (other then to have it reside somewhere on the net)?
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Member
posted Hide Post
@ Tony... How'd you get the alignment to match up between the graph and the table... is it just by setting wrap size or is there any other way.. i got a report that has 24 bars in the graph and that need to align to 24 columns in the table... problem is the values go into the millions in the columns and the client does not want the report to be too wide !!! any suggestions for alignments??


WebFOCUS 7.1.4
UNIX
HTML,PDF,EXL2K
 
Posts: 12 | Registered: July 17, 2009Report This Post
Expert
posted Hide Post
The output I posted was from a PDF output using the latest flavour of compound output, so it was a case of matching the graphic positioning and width to match the tabular output which had same width columns using TYPE=REPORT, WRAP=n.nn, WIDTH=n.nn, $

I have achieved a similar result in HTML at a previous client some 5 years ago using release 5.3.2, so you should still be able to action either of these outputs using your 7.1.4.

If most of your a of the data values are over, say, 10,000 then how about dividing by 1000 and posting the data with a trailing "K" or annotate the report to identify that the results are in 1000's?

For Excel output I suggest to the users that, as only a few mouse clicks will supply them with a graph for a given data grid, there might be a call for them not to be so lazy and click away Wink Trouble is that the users get so used to getting their graphic and grid results in the other two main formats that they want that extra inch every time!

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
Member
posted Hide Post
thanks for that.. i have implemented the dividing by thousands and put up a specifc annotation.... for the alignment in html i had to work on the wrap sizing as mentioned.. however, the client wants the entire report to fit in a legal landscape paper... i have been trying to get everything in to a PDF but i hit upon a problem where in i cannot color ITEMS in the FOOTING/SUBFOOT... is ther any other way to get around this coloring issue ?


WebFOCUS 7.1.4
UNIX
HTML,PDF,EXL2K
 
Posts: 12 | Registered: July 17, 2009Report This Post
Expert
posted Hide Post
You just have to ensure that the style key words are correct -

APP PREPENDPATH IBISAMP
DEFINE FILE GGSALES
  YRMONTH/I6MYY = DATE
END
GRAPH FILE GGSALES
  SUM DOLLARS
   BY YRMONTH
WHERE DATE GE '19970101'
ON TABLE HOLD AS GRAPH01 FORMAT GIF
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET GRID OFF
-*ON GRAPH SET VAXIS 6
-*ON GRAPH SET HAXIS 12
ON GRAPH SET GRAPHSTYLE *
setGraphType(18);
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(false);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(false);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
setFillType(getSeries(0),1);
setSeriesFillColor(0,new Color(255,255,120));
setFillType(getSeries(1),1);
setSeriesFillColor(1,new Color(255,120,255));
setFillType(getSeries(2),1);
setSeriesFillColor(2,new Color(120,255,255));
setFillType(getSeries(3),1);
setSeriesFillColor(3,new Color(080,080,255));
ENDSTYLE
END
-RUN
SET HTMLARCHIVE=ON
COMPOUND LAYOUT PCHOLD FORMAT PDF
UNITS=IN, $
SECTION=section1, LAYOUT=ON, METADATA='0.5^0.5^0.5^0.5', MERGE=OFF, ORIENTATION=LANDSCAPE, PAGESIZE=A4, $
-* Section - Area Dashboard
PAGELAYOUT=1, NAME='Layout page 1', text='Form', BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='0^0.5^0^0.5', $
OBJECT=IMAGE, NAME='Graph1', IMAGE=graph01.gif, POSITION=(0.630 0.467), DIMENSION=(11.337 3.275), $
COMPONENT='Report1', TEXT='Report', POSITION=(1.380 3.400), DIMENSION=(10.167 2.085), $
END
SET COMPONENT='Report1'
TABLE FILE GGSALES
   SUM DOLLARS
    BY REGION  AS ''
ACROSS YRMONTH AS ''
WHERE DATE GE '19970101'
ON TABLE SUBFOOT
"Colouring <+0> should <+0> be <+0> simple enough"
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE OFF
ON TABLE SET STYLE *
  UNITS=IN, PAGESIZE='A4', LEFTMARGIN=0.19, RIGHTMARGIN=0.19, TOPMARGIN=0.00, BOTTOMMARGIN=0.00,
  SQUEEZE=ON, ORIENTATION=LANDSCAPE, SIZE=8, GRID=ON, $
  TYPE=REPORT, FONT='ARIAL', SIZE=8, COLOR=BLACK, BACKCOLOR='NONE', STYLE=NORMAL, WRAP=OFF, $
  TYPE=REPORT, COLUMN=DOLLARS(*), WIDTH=0.455, WRAP=0.455, $
  TYPE=TABFOOTING, ITEM=1, COLOR=RED, $
  TYPE=TABFOOTING, ITEM=2, COLOR=GREEN, $
  TYPE=TABFOOTING, ITEM=3, COLOR=BLUE, $
  TYPE=TABFOOTING, ITEM=4, COLOR=ORANGE, $
ENDSTYLE
END
-*
COMPOUND END
-RUN

T

This message has been edited. Last edited by: Tony A,



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
Member
posted Hide Post
Smiler i guess i was not specific... i meant BACKCOLOR... when i try using the BACKCOLOR for every item (even for the above code) only the first color is applied and that too for the entire subfoot... Frowner


WebFOCUS 7.1.4
UNIX
HTML,PDF,EXL2K
 
Posts: 12 | Registered: July 17, 2009Report This Post
Expert
posted Hide Post
... Ah, that old problem .... Hmmm

Have you checked out Mickey Grackin's articles in the tips and techniques section? or Waz'z on PDF manipulation?

Either may or may not be helpful in your goal.

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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CODE] Multiple fields in Bar Chart Titles

Copyright © 1996-2020 Information Builders