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     Controlling Graph Bars

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Controlling Graph Bars
 Login/Join
 
Gold member
posted
Hello All!

I have a minor problem with a report. I need to have the graph bars printed as the last column but based on the first column. i.e. based on column SEATS but displayed after column LENGTH.

TABLE FILE CAR
PRINT
SEATS
SALES
LENGTH
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
GRAPHTYPE=DATA,COLUMN=SEATS,GRAPHLENGTH=1,GRAPHCOLOR=SILVER,$
ENDSTYLE
END

is there a way this can be done. I have tried repeating the seats column as noprint without success...


DEFINE FILE CAR
BAR/I11=SEATS;
END
TABLE FILE CAR
PRINT
SEATS
SALES
LENGTH
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
GRAPHTYPE=DATA,COLUMN=BAR,GRAPHLENGTH=1,GRAPHCOLOR=SILVER,$
ENDSTYLE
END

any suggestions?? Eeker

Thanks
Cynthia


PROD: WebFOCUS 7.1.0 on Linux/Tomcat 5.5.12 (standalone)/Informix on AIX
TEST: WebFOCUS 7.1.3 on Linux/Tomcat 5.5.16 (standalone)/Informix on AIX
 
Posts: 53 | Location: Montreal,Quebec,Canada | Registered: February 13, 2006Report This Post
Virtuoso
posted Hide Post
try this solution from Francis Mariani

DEFINE FILE CAR
SALESA/D10 = IF COUNTRY EQ 'W GERMANY' THEN 0 ELSE SALES / 1000;
END

TABLE FILE CAR
SUM
SALES/D10
COMPUTE SALES_BAR/A50 = BAR(50, SALESA, 50, '|', 'A50');        

BY COUNTRY

ON TABLE SET STYLE *
TYPE=DATA, COLUMN=SALES_BAR, COLOR=BLUE, $
END





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

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Gold member
posted Hide Post
Niiiiiiiiiiiice!!! Big Grin

Thanks FrankDutch & Francis Mariani!

Cheers,
Cynthia


PROD: WebFOCUS 7.1.0 on Linux/Tomcat 5.5.12 (standalone)/Informix on AIX
TEST: WebFOCUS 7.1.3 on Linux/Tomcat 5.5.16 (standalone)/Informix on AIX
 
Posts: 53 | Location: Montreal,Quebec,Canada | Registered: February 13, 2006Report This Post
Expert
posted Hide Post
Cynthia, have a look at this article
GRAPHTYPE kicking it up a notch




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Gold member
posted Hide Post
Susannah,

Thanks for the link. I did see your great article!!!
However, I had trouble manipulating the graph bar, I wasnt able to acheive what I posted up there.

Cynthia


PROD: WebFOCUS 7.1.0 on Linux/Tomcat 5.5.12 (standalone)/Informix on AIX
TEST: WebFOCUS 7.1.3 on Linux/Tomcat 5.5.16 (standalone)/Informix on AIX
 
Posts: 53 | Location: Montreal,Quebec,Canada | Registered: February 13, 2006Report This Post
Gold member
posted Hide Post
Hello All,
It's me again. So although the Bar function did the job.
The managers are still requiring graph bars which brings me back to my original post
how to make a graph bar based on the first colum put displayed at the end of all columns?

any suggestions?

Thanks

Cynthia


PROD: WebFOCUS 7.1.0 on Linux/Tomcat 5.5.12 (standalone)/Informix on AIX
TEST: WebFOCUS 7.1.3 on Linux/Tomcat 5.5.16 (standalone)/Informix on AIX
 
Posts: 53 | Location: Montreal,Quebec,Canada | Registered: February 13, 2006Report This Post
Virtuoso
posted Hide Post
If the former solution is not what you (they) want it is not possible to do it in an other way.
I have been trying this also.
The colored bar is always next to the value table and setting that value to noprint, will remove the bars also.
You have to convince them or see if you can do this in the graphic function, but I suppose that's not a real option.

I will see some people from IBI one of these days, I will ask if it might be a change.




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

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Virtuoso
posted Hide Post
If this is HTML, then this can be done.

1) create a javascript file in one of your apps called what ever you want.... e.g. /baseapp/removeCol.js
2) In you fex, include the js file by issuing: SET JSURL=/approot/baseapp/removeCol.js
3) Run your request.

/baseapp/removeCol.js
function remCol() {
     var rowList = document.getElementsByName("TR");
     for (var i=1; i<rowList.length; i++) {
          var colList = rowList[i].getElementsByTagName("TD");
          rowList[i].removeChild(colList[colList.length-2])
     }
}

if (window.addEventListener) {
     window.addEventListener('load', 'remCol', false);
} else if (window.attachEvent) {
     window.attachEvent('onload', remCol);
} else {
     alert("not supported");
}
  


The idea here is that the above code will remove the second last column of every row in the table output. In your case this should remove the numbers in the column just left of your visualized graphs.

Good Luck

Forgot to mention one thing. The column you are trying to graph should exist in your report twice. Once where you want the number to be displayed, and a second time at the end of the report with the visualize turned on.

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


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Virtuoso
posted Hide Post
Great

she wanted it in a pdf, but this html is usable for me....

thanks




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

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Gold member
posted Hide Post
So here's a workaround we found:

It’s basically repeating the column to be graphed bar on and putting the font-color to White.

The only thing is that it creates unnecessary white space....


DEFINE FILE CAR
MYBAR/I11 = SEATS;
END
TABLE FILE CAR
PRINT
SEATS
SALES
LENGTH

ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
GRAPHTYPE=DATA,COLUMN=MYBAR,FONT=WHITE,$
GRAPHTYPE=DATA,COLUMN=MYBAR,GRAPHLENGTH=1,GRAPHCOLOR=SILVER,$
ENDSTYLE
END


Thanks for all your inputs!

Cynthia


PROD: WebFOCUS 7.1.0 on Linux/Tomcat 5.5.12 (standalone)/Informix on AIX
TEST: WebFOCUS 7.1.3 on Linux/Tomcat 5.5.16 (standalone)/Informix on AIX
 
Posts: 53 | Location: Montreal,Quebec,Canada | Registered: February 13, 2006Report This Post
Expert
posted Hide Post
Cynthia,

If I run your code as-is, I get this error:

(FOC3203) UNRECOGNIZED FONT IN STYLESHEET FILE AT LINE: 1

The error points to FONT=WHITE, which should be COLOR=WHITE, unless you have a font installed called WHITE.

As well, MYBAR is not mentioned in the TABLE request, so you won't get a bar for it.

Just wondering if you could post the working code.

Cheers and thanks.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
If you use SQUEEZE=ON, the gap between the last visible column and the bar may become narrower.

I tried changing the font size of MYBAR to 1, but that affects the height of the bar!

DEFINE FILE CAR
MYBAR/P5 = SEATS;
END
TABLE FILE CAR
PRINT
SEATS
SALES
LENGTH
MYBAR AS ''
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, FONT='Arial', SQUEEZE=ON,$
TYPE=DATA, COLUMN=MYBAR, COLOR=WHITE, WRAP=12, $
GRAPHTYPE=DATA,COLUMN=MYBAR,GRAPHLENGTH=1,GRAPHCOLOR=SILVER,$
ENDSTYLE
END


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
oops sorry about that,
I had two windows open and copied the wrong code. My proper code is:

DEFINE FILE CAR
MYBAR/I11 = SEATS;
END
TABLE FILE CAR
PRINT
SEATS
SALES
LENGTH
MYBAR AS ''
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
GRAPHTYPE=DATA,COLUMN=MYBAR,COLOR=WHITE,$
GRAPHTYPE=DATA,COLUMN=MYBAR,GRAPHLENGTH=1,GRAPHCOLOR=SILVER,$
ENDSTYLE
END

About the wrap that you have added yes it reduces the white space but you have to keep it mind that it's because it's based on 1 digit as soon as have you let's say 3 digits (i.e. seats = 100) the white space becomes bigger. The white space represents the number of digits, the large the number the larger the space...

Here is a fast example:

DEFINE FILE CAR
MYSEATS /P5= IF SEATS EQ 2 THEN 1000 ELSE SEATS;
MYBAR/P5 = MYSEATS;
END
TABLE FILE CAR
PRINT
MYSEATS
SALES
LENGTH
MYBAR AS ''
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, FONT='Arial', SQUEEZE=ON,$
TYPE=DATA, COLUMN=MYBAR, COLOR=WHITE, WRAP=12, $
GRAPHTYPE=DATA,COLUMN=MYBAR,GRAPHLENGTH=1,GRAPHCOLOR=SILVER,$
ENDSTYLE
END


Thanks
Cynthia


PROD: WebFOCUS 7.1.0 on Linux/Tomcat 5.5.12 (standalone)/Informix on AIX
TEST: WebFOCUS 7.1.3 on Linux/Tomcat 5.5.16 (standalone)/Informix on AIX
 
Posts: 53 | Location: Montreal,Quebec,Canada | Registered: February 13, 2006Report This Post
Expert
posted Hide Post
Cynthia,

I'm sorry, the WRAP=12 shouldn't have been there, it has no effect. It doesn't look like we can get the bars any closer to the last visible column.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report 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     Controlling Graph Bars

Copyright © 1996-2020 Information Builders