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.
I am developing a bar graph and I need legend (which is data) in a specific order. So, I used a DEFINE sort field in my processing and assigned the needed order and added it with a NOPRINT to graph request. Even though its NOPRINT, legend is showing the numbers from SORT_CNTRY instead of the name from COUNTRY.
DEFINE FILE CAR
SORT_CNTRY/I1 = IF COUNTRY EQ 'FRANCE' THEN 1 ELSE
IF COUNTRY EQ 'ENGLAND' THEN 2 ELSE
IF COUNTRY EQ 'JAPAN' THEN 3 ELSE
IF COUNTRY EQ 'ITALY' THEN 4 ELSE 5;
END
GRAPH FILE CAR
SUM
SALES AS ''
BY HIGHEST SORT_CNTRY NOPRINT
BY COUNTRY AS ''
ACROSS BODYTYPE AS ''
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 900
ON GRAPH SET VAXIS 600
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
ENDSTYLE
END
Please suggest.
ThanksThis message has been edited. Last edited by: BI_Developer,
DEFINE FILE CAR
COUNTRY_C/A1=IF COUNTRY EQ 'FRANCE' THEN '1' ELSE IF COUNTRY EQ 'JAPAN' THEN '2' ELSE '3';
END
GRAPH FILE CAR
SUM
SALES AS ''
ACROSS BODYTYPE
BY COUNTRY_C
BY COUNTRY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 900
ON GRAPH SET VAXIS 600
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 2
ON GRAPH SET GRXAXIS 1
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
ON GRAPH SET STYLE *
TYPE=DATA, COLUMN=COUNTRY_C, COLOR='WHITE', $
ENDSTYLE
END
I think JSCHART is available only version 8 and later? HTML5 compatible browser as well. I can run that in 8.0.09 I have in test but not 7.7.03 I have in production.
8.2.03 AIX Client Windows Tomcat DB2, Terradata, SQL, Oracle
Posts: 56 | Location: Fort Worth, Texas USA | Registered: January 27, 2012
DEFINE FILE CAR
SORT_CNTRY/I1 = IF COUNTRY EQ 'FRANCE' THEN 1 ELSE
IF COUNTRY EQ 'ENGLAND' THEN 2 ELSE
IF COUNTRY EQ 'JAPAN' THEN 3 ELSE
IF COUNTRY EQ 'ITALY' THEN 4 ELSE 5;
NEW_SORT/A1=EDIT(SORT_CNTRY);
NEW_COUNTRY/A50=NEW_SORT|':'|COUNTRY;
END
GRAPH FILE CAR
SUM
SALES AS ''
BY HIGHEST NEW_COUNTRY
ACROSS BODYTYPE AS ''
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 900
ON GRAPH SET VAXIS 600
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
ON GRAPH SET GRAPHSTYLE *
setPlace(true);
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
ENDSTYLE
END
I think it's the GRMERGE setting that causes multiple graphs. From the doc:
quote:
The GRMERGE parameter generates a three-dimensional graph that reflects all output data from a request containing multiple sort fields, or creates separate graphs that collectively reflect all output data. When GRMERGE is OFF, a request containing both a BY and an ACROSS phrase generates two graphs. When it is ON, one graph results.
The syntax is:
SET GRMERGE = {ON|OFF|ADVANCED} where:
ON - Generates a single three-dimensional graph that reflects all output data. ON is the default.
OFF - Generates separate graphs that collectively reflect all output data.
ADVANCED - Turns on the advanced merge option. This option uses three parameters to determine how to merge the graphs:
GRMULTIGRAPH, which specifies how many sort fields to use to create multiple graphs. GRLEGEND, which specifies how many sort fields to place on the graph legend. GRXAXIS, which specifies how many sort fields to display on the X-axis. GRXAXIS must be at least 1 in order to plot the graph. A value greater than one creates nested X-axes.
Note: The sum of the sort fields used by GRMULTIGRAPH, GRLEGEND, and GRXAXIS must equal the number of sort fields in the graph request.
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
I tried this and got it to work before posting my question here. User does not like to see concatenated numbers.
quote:
Originally posted by nick z: Hi, You can concatinate 2 fields:
DEFINE FILE CAR
SORT_CNTRY/I1 = IF COUNTRY EQ 'FRANCE' THEN 1 ELSE
IF COUNTRY EQ 'ENGLAND' THEN 2 ELSE
IF COUNTRY EQ 'JAPAN' THEN 3 ELSE
IF COUNTRY EQ 'ITALY' THEN 4 ELSE 5;
NEW_SORT/A1=EDIT(SORT_CNTRY);
NEW_COUNTRY/A50=NEW_SORT|':'|COUNTRY;
END
GRAPH FILE CAR
SUM
SALES AS ''
BY HIGHEST NEW_COUNTRY
ACROSS BODYTYPE AS ''
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 900
ON GRAPH SET VAXIS 600
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
ON GRAPH SET GRAPHSTYLE *
setPlace(true);
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
ENDSTYLE
END
Originally posted by Francis Mariani: I think it's the GRMERGE setting that causes multiple graphs. From the doc:
quote:
The GRMERGE parameter generates a three-dimensional graph that reflects all output data from a request containing multiple sort fields, or creates separate graphs that collectively reflect all output data. When GRMERGE is OFF, a request containing both a BY and an ACROSS phrase generates two graphs. When it is ON, one graph results.
The syntax is:
SET GRMERGE = {ON|OFF|ADVANCED} where:
ON - Generates a single three-dimensional graph that reflects all output data. ON is the default.
OFF - Generates separate graphs that collectively reflect all output data.
ADVANCED - Turns on the advanced merge option. This option uses three parameters to determine how to merge the graphs:
GRMULTIGRAPH, which specifies how many sort fields to use to create multiple graphs. GRLEGEND, which specifies how many sort fields to place on the graph legend. GRXAXIS, which specifies how many sort fields to display on the X-axis. GRXAXIS must be at least 1 in order to plot the graph. A value greater than one creates nested X-axes.
Note: The sum of the sort fields used by GRMULTIGRAPH, GRLEGEND, and GRXAXIS must equal the number of sort fields in the graph request.
This really only works for a limited number of known values, but you can use this trick of placing spaces in front of the values. The spaces get compressed in the output.
DEFINE FILE CAR
SORT_CNTRY/A15 = IF COUNTRY EQ 'FRANCE' THEN ' FRANCE' ELSE
IF COUNTRY EQ 'ENGLAND' THEN ' ENGLAND' ELSE
IF COUNTRY EQ 'JAPAN' THEN ' JAPAN' ELSE
IF COUNTRY EQ 'ITALY' THEN ' ITALY' ELSE COUNTRY ;
END
-*
GRAPH FILE CAR
SUM SALES AS ''
BY HIGHEST SORT_CNTRY
ACROSS BODYTYPE AS ''
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 900
ON GRAPH SET VAXIS 600
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
ENDSTYLE
END
This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
What you can do is add extra legend labels and give them any text you like. You would then start your legend from that extra legend markers. Here is a sample code. I basically colored the extra legend markers to be the same color as each series from the stylesheet:
DEFINE FILE CAR
SORT_CNTRY/I1 = IF COUNTRY EQ 'FRANCE' THEN 1 ELSE
IF COUNTRY EQ 'ENGLAND' THEN 2 ELSE
IF COUNTRY EQ 'JAPAN' THEN 3 ELSE
IF COUNTRY EQ 'ITALY' THEN 4 ELSE 5;
END
GRAPH FILE CAR
SUM
SALES AS ''
BY HIGHEST SORT_CNTRY NOPRINT
BY COUNTRY AS ''
ACROSS BODYTYPE AS ''
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 900
ON GRAPH SET VAXIS 600
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setLegendSeriesStart(5);
setMarkerShape(getAllSeries(),1);
setTextString(getLegendLabel(0),"W GERMANY");
setDisplay(getLegendLabel(0),true);
setFillColor(getLegendLabelMarker(0),new Color(158,144,188));
setBorderColor(getLegendLabelMarker(0),new Color(158,144,188));
setTextString(getLegendLabel(1),"ITALY");
setDisplay(getLegendLabel(1),true);
setFillColor(getLegendLabelMarker(1),new Color(255,243,172));
setBorderColor(getLegendLabelMarker(1),new Color(255,243,172));
setTextString(getLegendLabel(2),"JAPAN");
setDisplay(getLegendLabel(2),true);
setFillColor(getLegendLabelMarker(2),new Color(106,189,187));
setBorderColor(getLegendLabelMarker(2),new Color(106,189,187));
setTextString(getLegendLabel(3),"ENGLAND");
setDisplay(getLegendLabel(3),true);
setFillColor(getLegendLabelMarker(3),new Color(240,159,97));
setBorderColor(getLegendLabelMarker(3),new Color(240,159,97));
setTextString(getLegendLabel(4),"FRANCE");
setDisplay(getLegendLabel(4),true);
setFillColor(getLegendLabelMarker(4),new Color(195,218,125));
setBorderColor(getLegendLabelMarker(4),new Color(195,218,125));
ENDSTYLE
END
To make sure your colors match you can remove setLegendSeriesStart(5);