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]webfocus 8 stacked bar graph legend display issue

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved]webfocus 8 stacked bar graph legend display issue
 Login/Join
 
Member
posted
plotting stacked bar graph in webFOCUS 8 using car file.I defined a sort field - if bodytype is sedan then 1 else everything is 2.Graphs legend text shows 1 and 2 as description instead of bodytype like sedan,coupe. .etc.Can anyone help me out with this issue.

DEFINE FILE CAR
SORTA/I2 = IF BODYTYPE EQ 'SEDAN' THEN 1 ELSE 2;

END

ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE CAR
SUM CAR.BODY.SALES
BY CAR.BODY.SORTA
ACROSS CAR.ORIGIN.COUNTRY

ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBRSTK1
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*END
ENDSTYLE
END
-RUN

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


WebFOCUS 8
Windows, All Outputs
 
Posts: 23 | Registered: April 16, 2015Report This Post
Virtuoso
posted Hide Post
Try this:

DEFINE FILE CAR
SORTA/I2  = IF BODYTYPE EQ 'SEDAN' THEN 1 ELSE 2;
SORTX/A10 = IF BODYTYPE EQ 'SEDAN' THEN 'SEDAN' ELSE 'OTHER';
END

ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';

GRAPH FILE CAR
SUM CAR.BODY.SALES
BY SORTA NOPRINT
BY SORTX
ACROSS CAR.ORIGIN.COUNTRY

ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 2
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBRSTK1
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
setCurveFitEquationDisplay(false); 
setPlace(true); 
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*END
ENDSTYLE
END
-RUN
[code]

Pay attention to :
[code]
DEFINE FILE CAR
SORTA/I2  = IF BODYTYPE EQ 'SEDAN' THEN 1 ELSE 2;
SORTX/A10 = IF BODYTYPE EQ 'SEDAN' THEN 'SEDAN' ELSE 'OTHER';
END


BY SORTA NOPRINT
BY SORTX

And
ON GRAPH SET GRLEGEND 2
ON GRAPH SET GRXAXIS 1


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
CuriousDev,

A couple things first, I don't know if you've downloaded the PDF "Creating HTML5 Charts with WebFOCUS Language" yet, but I would recommend doing so. There is a lot of good stuff in there. I would recommend downloading the latest version. IBI uses a plug in for its JSCharts and I don't think they actually own any of the code (Just like they've integrated JQuery). So I found out that the 8.1.03 version of the document has a lot more documented then the 8.0.08 version, yet everything I've experimented that is not in the v8.0.08 documentation still works. If you were to find the original documentation from the JSChart plug in, then you might be able to find even more things that you can effect and get your hands on.

Also a little over a week ago, GavinL posted this: http://forums.informationbuild...1057331/m/5377035576

I would recommend looking at that, because if you're looking at changing the Legend, you probably want to update your tooltips as well.

As for your specific problem, I don't know if I have your exact solution, but if you only have 2 sort types, I'm assuming you are using that sorting to create 2 groups for your stack graph that you want to appear in a certain order. Going on the assumption that you only have two values, I would suggest not using a number sequence, but the actual text values that you would like to see in the Legend. You can then control which order they appear in by designating
 BY HIGHEST CAR.BODY.SORTA 
or
 BY LOWEST CAR.BODY.SORTA 
.

As I was looking over the PDF document, I didn't see any way to programmatically change the labels of the legend.

Another option you might have, but will be a lot more work is you could most likely build an annotation instead of using the legend. You would have complete control over what it says, but it would take more time to build.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Expert
posted Hide Post
quote:
I found out that the 8.1.03 version of the document has a lot more documented then the 8.0.08 version
Thanks for this tip Eric.


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
Member
posted Hide Post
Martin Y your solution looks good but if i have 10 bodytypes and in future it will keep on increasing .i can't hard code it as your example.


WebFOCUS 8
Windows, All Outputs
 
Posts: 23 | Registered: April 16, 2015Report This Post
Master
posted Hide Post
Welcome Francis.

I figured out that the 8.1.03 version of the document had more in it when I saw GavinL's post. I looked at it and went "Hey none of these commands are in my document".

I also had previously taken a look at the HTML generated when using JSCharts and noticed a call to a javascript library(tdgchart-min.js). I googled the library to find that someone else had developed it. The documentation on that site though wasn't very good. I found IBI's documentation to be much better. But maybe there is better documentation out there then what I found. And if so, maybe IBI hasn't documented everything available. There might be more that we can take advantage of.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Virtuoso
posted Hide Post
I was showing one way to do it using your example CuriousDev. It's sure that it must be adapted to your situation.

eric solution can also be one that you must consider but once again, we are not aware of all your specs and we're not here to do the job for you; just helping you finding a solution by giving you track to explore.


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
Member
posted Hide Post
Issue is solved.


WebFOCUS 8
Windows, All Outputs
 
Posts: 23 | Registered: April 16, 2015Report 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]webfocus 8 stacked bar graph legend display issue

Copyright © 1996-2020 Information Builders