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'm trying to figure out how to get the 0 values on a dual axis chart scale to be in unison with one and other. with all positive values, this works fine. Not so much with negative values. Here's the car file I'm playing around with.
Does anyone have ideas? It looks like you can be clever with the way the scales calculate. If there's a simpler solution, I'd love to hear what it is .
GRAPH FILE car
SUM
COMPUTE cost_new/D12.2=IF COUNTRY EQ 'FRANCE' THEN -2000 ELSE 7400000;
CAR.CAR.SEATS
BY CAR.CAR.COUNTRY
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBAR2AX
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setPlace(true);
setCurveFitEquationDisplay(false);
*END
INCLUDE=Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setAxisAssignment( $0, 0);
setAxisAssignment( $1, 1);
*GRAPH_JS_FINAL
"pieProperties": {
"holeSize": "0%"
},
"agnosticSettings": {
"dual": true,
"chartTypeFullName": "Bar_Clustered_Dual_Axis"
}
*END
ENDSTYLE
END
-RUN
-*IA_GRAPH_FINISH
Thanks in advance!!This message has been edited. Last edited by: Brandon Andrathy,
My initial thought is for DEFINE cost_new instead of using COMPUTE. Then SUM cost_new and use cost_new as you first sort with a NOPRINT. Let me know if that works. Otherwise, please be more specific in your requirement.
Or, do you really want a dual axis chart in the first place. What you provided is just bar chart with the sum of two differ fields.
Also please use 'closer number' such as '-2000 and 4000', instead of "-2000 and 7400000" just for visual clarity. You may also want to use AUTOSIZE.
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
I'm thinking that the following post is the issue you are trying to solve: Align both Axis on Dual Axis Graph Unfortunately, the conclusion is that they don't think it is possible, but there are some suggestions of alternatives.
WebFOCUS 8.2.06
Posts: 210 | Location: Sterling Heights, Michigan | Registered: October 19, 2010
If the Align both Axis on Dual Axis Graph post explains the issue, then I think that this is possible. I think that both axis of the dual axis chart should use the min and max of the combined values. That is to say, take the max used for each half of the dual/two charts and the same for the min. That way both are using the same min and max, thus they should be the same with the zero lined up equally. You'll need to account for the zeros and missing values...
It sounds like an interesting challenge that I don't really have time ti accept without verification of and elaboration on the initial requirements. Perhaps an image of what is desired as the final result would help. I just can't imagine it now...
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
However, one way to make Y1 and Y2 have the same 0 line, is to force them to have the same minimum and maximum. In severe cases, that might cause one side to be comparatively so small that you'll hardly be able to read them. But if that's the spec you've been given here's an example. Find out the top and bottom range of one chart and set it to be the same on the other.
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
-DEFAULTH &WF_HTMLENCODE=OFF;
SET HTMLENCODE=&WF_HTMLENCODE
SET ARGRAPHENGINE=JSCHART
-DEFAULTH &WF_EMPTYREPORT=ON;
SET EMPTYREPORT=&WF_EMPTYREPORT
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_ARVERSION=2;
SET ARVERSION=&WF_ARVERSION
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE ibisamp/car
-* Created by Info Assist for Graph
SUM COMPUTE TESTVAL/D12.2=IF COUNTRY EQ 'FRANCE' THEN -5000 ELSE SALES;
CAR.BODY.RETAIL_COST
BY CAR.ORIGIN.COUNTRY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO 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 LOOKGRAPH BAR
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/ibi_themes/Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, ORIENTATION=LANDSCAPE, $
TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, BUCKET=y-axis(1), $
TYPE=DATA, COLUMN=N3, BUCKET=y-axis(2), $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setScaleMinAuto(getY2Axis(),false);
setScaleMin(getY2Axis(),-20000.0);
setScaleMaxAuto(getY2Axis(),false);
setScaleMax(getY2Axis(),100000.0);
*GRAPH_JS_FINAL
"pieProperties": {
"holeSize": "0%"
},
"agnosticSettings": {
"dual": true,
"chartTypeFullName": "Bar_Clustered_Dual_Axis"
}
*END
ENDSTYLE
END
-RUN
WebFOCUS 8206, Unix, Windows
Posts: 1853 | Location: New York City | Registered: December 30, 2015
Thank you Babak. Yeah I considered the option you proposed. Unfortunately the numbers are very different between the two axes. Agreed they are hard to read.
BabakNYC, Pulls thru again... I lkie the dual use of the axis. Still needed, to accomplish this, is the min and max values to get the zero value to line-up as requested.