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     [CLOSED] Line Graph - BY and ACROSS

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Line Graph - BY and ACROSS
 Login/Join
 
Platinum Member
posted
Hello

Below is my sample table request.
TABLE FILE DATA
PRINT
	VALUE
BY GROUP
BY YEAR
BY MNTH
ON TABLE HOLD AS GRAPH_DATA
END

GROUP                YEAR   MONTH   VALUE
A                    1990   01      100
A                    1990   02      110
A                    1990   03      111
A                    1990   04      112
A                    1990   05      113
A                    1990   06      114
A                    1990   07      115
A                    1990   08      116
A                    1990   09      117
A                    1990   10      118
A                    1990   11      119
A                    1991   12      120
A                    1991   01      121
A                    1991   02      122
A                    1991   03      123
A                    1991   04      124
A                    1991   05      115
A                    1991   06      116
A                    1991   07      117
A                    1991   08      112
A                    1991   09      117
A                    1991   10      114
A                    1991   11      127
A                    1991   12      144


B                    1990   01      107
B                    1990   02      119
...
B                    1990   12      113
B                    1991   01      141
...
B                    1991   12      122 

C                    1990   01      107
C                    1990   02      119
...
C                    1990   12      113
C                    1991   01      141
...
C                    1991   12      122


I am trying to do a line graph in WF 8 (JSCHART) and below is the code. I want to have VALUE in Y-axis and YEAR in X-axis. And I want a line each for each unique value in GROUP. As per data above 3 lines with 1 each of A, B, C. There is no need to show the month.
ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='305.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE GRAPH_DATA
-* Created by Info Assist for Graph
SUM GRAPH_DATA.GRAPH_DATA.VALUE AS ''
BY GROUP
ACROSS GRAPH_DATA.GRAPH_DATA.YEAR AS ''
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 ON
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET AUTOFIT OFF
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setUseSeriesShapes(true);
setMarkerSizeDefault(50);
*END
INCLUDE=endeflt.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setSeriesType(0,2);
setDataTextPosition(1);
setDisplay(getDataText(),false);
setDataTextDisplay(false);
setCurveFitType(0,0);
setMarkerShape(getAllSeries(),0);

-*Y1 Axis
setDisplay(getY1AxisLine(),true);
setBorderColor(getY1AxisLine(),new Color(255,255,255));
setBorderColor(getY1ZeroLine(),new Color(255,255,255));
setFillColor(getY1ZeroLine(),new Color(255,255,255));
setDisplay(getY1MajorGrid(),true);
setFontStyle(getY1Label(),0);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeInPoints(getY1Label(),8);
setPlaceResize(getY1Label(),0);
setTextString(getY1Title(),"Numbers");
setDisplay(getY1Title(),true);
setScaleMaxAuto(getY1Axis(),false);
setScaleMinAuto(getY1Axis(),false);
setScaleMax(getY1Axis(),100);
setScaleMin(getY1Axis(),50);
setGridStep(getY1MajorGrid(),10);
setGridStepAuto(getY1MajorGrid(),false);
setSeriesType(getSeries(0),2);
setBorderColor(getY1MajorGrid(),new Color(237,237,237));
setAltFmtFrameNumColors(getY1AltFmtFrame(),5);

setFillColor(getSeries(0),new Color(0,153,76));
setFillColor(getFrame(),new Color(255,255,255));
setTextRotation(getO1Label(),2);
setFontSizeAbsolute(getO1Label(),true);
setFontSizeInPoints(getO1Label(),7);
*GRAPH_JS

"introAnimation": {
    "duration": 1000,
    "enabled": true
},
"riserBevel": "bevel"
,
*END
ENDSTYLE
END


I am not able to get it correctly. I made some changes. And then I am getting 1990, 1991 each 12 times on X-axis for 12 unique values for 12 months. I need to show year label only once. If that can't be avoided then I want to show month also with clean formatting.
Please suggest.

Thanks.

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


WF 8.2.01 APP STUDIO
PDF,HTML,EXL2K,Active
 
Posts: 139 | Registered: July 21, 2011Report This Post
Virtuoso
posted Hide Post
This does exactly what you're requesting using you're styling.
You may have issue with your data.
DEFINE FILE GGSALES
YR /YY = DATE;
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 GGSALES
SUM COMPUTE PCT/D6.2 = IF REGION EQ 'Northeast' THEN ((DOLLARS / BUDDOLLARS) / 1.2) * 100
                  ELSE IF REGION EQ 'Southeast' THEN ((DOLLARS / BUDDOLLARS) / 1.5) * 100
                  ELSE                               ((DOLLARS / BUDDOLLARS) / 1.8) * 100;
BY REGION
ACROSS YR AS ''
WHERE REGION NE 'Midwest';
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
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 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setUseSeriesShapes(true);
setMarkerSizeDefault(50);

*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);

setSeriesType(0,2);
setDataTextPosition(1);
setDisplay(getDataText(),false);
setDataTextDisplay(false);
setCurveFitType(0,0);
setMarkerShape(getAllSeries(),0);
setDisplay(getY1AxisLine(),true);
setBorderColor(getY1AxisLine(),new Color(255,255,255));
setBorderColor(getY1ZeroLine(),new Color(255,255,255));
setFillColor(getY1ZeroLine(),new Color(255,255,255));
setDisplay(getY1MajorGrid(),true);
setFontStyle(getY1Label(),0);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeInPoints(getY1Label(),8);
setPlaceResize(getY1Label(),0);
setTextString(getY1Title(),"Numbers");
setDisplay(getY1Title(),true);
setScaleMaxAuto(getY1Axis(),false);
setScaleMinAuto(getY1Axis(),false);
setScaleMax(getY1Axis(),100);
setScaleMin(getY1Axis(),50);
setGridStep(getY1MajorGrid(),10);
setGridStepAuto(getY1MajorGrid(),false);
setSeriesType(getSeries(0),2);
setBorderColor(getY1MajorGrid(),new Color(237,237,237));
setAltFmtFrameNumColors(getY1AltFmtFrame(),5);

setFillColor(getSeries(0),new Color(0,153,76));
setFillColor(getFrame(),new Color(255,255,255));
setTextRotation(getO1Label(),2);
setFontSizeAbsolute(getO1Label(),true);
setFontSizeInPoints(getO1Label(),7);
*GRAPH_JS

"introAnimation": {
    "duration": 1000,
    "enabled": true
},
"riserBevel": "bevel"
,
*END
ENDSTYLE
END
-RUN


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
Platinum Member
posted Hide Post
Martin, I already got this result before posting here. Data comes in wrong way with this. If data comes correct, I get 12 values of year on X-axis.. I mean 1990 shows up 12 times etc. This is what I am trying to avoid. Seems very simple but I am unable to achieve.


WF 8.2.01 APP STUDIO
PDF,HTML,EXL2K,Active
 
Posts: 139 | Registered: July 21, 2011Report 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     [CLOSED] Line Graph - BY and ACROSS

Copyright © 1996-2020 Information Builders