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 looked at the post [SOLVED] Format labels in dual axis graph in which Doug provided an expert solution to the issue of having two different dual axis label formats in a post dated July 2 around 10:59 a.m.
I integrated parts of it with some code we have here and worked with it quite a bit the past few days.
I had another team member look at it, too, and he tinkered with it a while. I'm having the same problem as outlined in the aforementioned post. I can get one or the other labels, but not both.
The code results in data labels (sitting above the bars) of $52 and $25,212. When you hover over the bars, I get 52% and $25,212 as per desired output.
I understand I need to set the appropriate formats. Just to be certain I understood them as thoroughly as I thought previously, I reviewed this information
Using : setTextFormatPreset(getDataText()..... set the setTextFormatPreset for all DataText. So if you want to have different one, you should specify to which one as you did for setTextFormatPattern
And pay attention not to have duplicate "set" lines, otherwise only the last one will be in effect (such as setDataTextPosition that was duplicated but in this case with the same option
As a complete sample:
GRAPH FILE CAR
SUM COMPUTE PCT /P6 = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100;
DEALER_COST
BY CAR
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 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 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, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setPieFeelerTextDisplay(1);
setDisplay(getY1Title(),false);
setPlaceResize(getY2Title(),0);
setFontStyle(getY2Title(),2);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeInPoints(getY1Label(),9);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeInPoints(getY2Label(),9);
setPlaceResize(getY1Label(),0);
setTextFormatPattern(getY1Label(),"#%/100");
setTextFormatPreset(getY1Label(),28);
setTextString(getY2Title(),"Dollars");
setDisplay(getY2Title(),false);
setTextFormatPreset(getY2Label(),-1);
setTextFormatPattern(getY2Label(),"$#");
setSeriesLabel(0,"Percent");
setSeriesLabel(1,"Dollars");
setAxisAssignment( $0, 0);
setAxisAssignment( $1, 1);
setDisplay(getO1MajorGrid(),false);
setGridStepAuto(getY2MajorGrid(),false);
setGridStep(getY2MajorGrid(),6)
setAltFmtFrameNumColors(getY2AltFmtFrame(),5);
setScaleMax(getY1Axis(),100.0);
setGridStepAuto(getY1MajorGrid(),false);
setGridStep(getY1MajorGrid(),20.0);
setDataTextDisplay(true);
setDisplay(getDataText(0),true);
setDisplay(getDataText(1),true);
setDataTextPosition(1);
setTextFormatPattern(getDataText(0),"#%/100");
setTextFormatPreset(getDataText(0),28);
setTextFormatPattern(getDataText(1),"$#");
setTextFormatPreset(getDataText(1),6);
*GRAPH_JS_FINAL
"pieProperties": {
"holeSize": "0%"
},
"agnosticSettings": {
"dual": true,
"chartTypeFullName": "Bar_Clustered_Dual_Axis"
}
*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, 2013
This leads me to ask: How can we get the value to be display 'On Hover' to match the value displayed at the top of the bars. In this example The values display On Hover are the same but missing the percent sign / currency symbol.
IMHO: The values displayed should be the same in all cases.
I do appreciate the use of the two 'setSeriesLabel' statements to show 'Dollars' and 'Percent'.
Then, I'll push this a bit and ask if it can be done within InfoAssist.
In FOCUS Since 1983 ~ from FOCUS to WebFOCUS. Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
Unfortunately, changing the code's few lines makes the situation much worse.
Right now, when I hover over both bars, the hovers perform correctly. I get % and $ signs appropriately.
When I look above the bars, I get labels above each bar, both with the dollar sign.
After I changed those few lines of code, the dollar sign no longer appears above the bar with dollars. The bar with percentages no longer displays no sign either. Additionally, the hover feature over the percentage bar results in 5,278''%.
If I followed the thread after you made your suggestion, I might have to adjust the hovers/tooltips. However, why would the code eliminate the signs in the data labels above the bars?
I've posted code again.
setUseSeriesShapes(true);
setMarkerSizeDefault(50);
setReportParsingErrors(false);
setSelectionEnableMove(false);
setPieFeelerTextDisplay(1);
setDepthAngle(45);
setPieTilt(10);
setPieDepth(70);
setDepthRadius(0);
setTextFormatPreset(getDataText(),0);
setDisplay(getY1Title(),false);
setFontName(getY1Label(),"Calibri");
setFontName(getY2Title(),"Calibri");
setFontName(getY2Label(),"Calibri");
setFontName(getDataText(),"Calibri");
setFontName(getO1Title(),"Calibri");
setFontName(getX1Title(),"Calibri");
setFontName(getSubtitle(),"Calibri");
setFontName(getAllText(),"Calibri");
setFontSizeAbsolute(getY2Title(),true);
setFontSizeInPoints(getY2Title(),9);
setPlaceResize(getY2Title(),0);
setFontStyle(getY2Title(),2);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeInPoints(getY1Label(),9);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeInPoints(getY2Label(),9);
setPlaceResize(getY1Label(),0);
setTextFormatPattern(getY1Label(),"#%");
setTextFormatPreset(getY1Label(),28);
setTextFormatPreset(getY2Label(),-1);
setTextFormatPattern(getY2Label(),"$#");
setDisplay(getLegendArea(),false);
setDisplay(getLegendArea(),true);
setFontName(getLegendText(),"Calibri");
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),9);
setPlaceResize(getLegendText(),0);
setDataTextDisplay(true);
setSeriesLabel(0,"Percent");
setSeriesLabel(1,"Dollars");
setAxisAssignment( $0, 0);
setAxisAssignment( $1, 1);
setDisplay(getO1MajorGrid(),false);
setGridStepAuto(getY2MajorGrid(),false);
setGridStep(getY2MajorGrid(),6)
setAltFmtFrameNumColors(getY2AltFmtFrame(),5);
setDisplay(getY1MajorGrid(),false);
setDisplay(getY2MajorGrid(),false);
setDisplay(getO1MajorGrid(),false);
setScaleMax(getY1Axis(),100.0);
setGridStepAuto(getY1MajorGrid(),false);
setGridStep(getY1MajorGrid(),20.0);
setDisplay(getDataText(0),true);
setDisplay(getDataText(1),true);
setDataTextPosition(1);
-*The code below is what I had that gave me dollar signs only for both data labels above the bars. I did eliminate the duplicate setDataTextPosition(1) line you referenced earlier.
-*setTextFormatPattern(getDataText(0),"#%");
-*setTextFormatPreset(getDataText(),28);
-*setTextFormatPattern(getDataText(1),"$#");
-*setTextFormatPreset(getDataText(),6);
-*The code you provided.
setTextFormatPattern(getDataText(0),"#%");
setTextFormatPreset(getDataText(0),28);
setTextFormatPattern(getDataText(1),"$#");
setTextFormatPreset(getDataText(1),6);
Below a simplified version (without duplicate setting row and/or opposite setting) 1- where the y-axis labels have the % or K attribute for thousand (which I think it's better since it takes less space to display), 2- where the bar top data text have also the proper % or $ sign, 3- but where the tooltip DOES NOT display % or $ (which seems not possible to have with VBAR2AX) but with the proper value displayed.
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET HTMLENCODE=ON
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
-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 COMPUTE PCT /P6C = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100;
DEALER_COST
BY CAR
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 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 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, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setAxisAssignment( $0, 0);
setAxisAssignment( $1, 1);
setFontName(getAllText(),"Calibri");
setFontName(getSubtitle(),"Calibri");
setFontName(getDataText(),"Calibri");
setFontName(getO1Title(),"Calibri");
setFontName(getO1Label(),"Calibri");
setFontName(getY1Label(),"Calibri");
setFontName(getY2Label(),"Calibri");
setFontName(getLegendText(),"Calibri");
setDisplay(getLegendArea(),true);
setPlaceResize(getLegendText(),0);
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),9);
setSeriesLabel(0,"Percent");
setDisplay(getY1Title(),false);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeInPoints(getY1Label(),9);
setTextFormatPattern(getY1Label(),"#%/100");
setTextFormatPreset(getY1Label(),28);
setSeriesLabel(1,"Dollars");
setDisplay(getY2Title(),false);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeInPoints(getY2Label(),9);
setTextFormatPattern(getY2Label(),"$#");
setTextFormatPreset(getY2Label(),7);
setDataTextPosition(1);
setDisplay(getDataText(0),true);
setTextFormatPattern(getDataText(0),"#%/100");
setTextFormatPreset(getDataText(0),28);
setDisplay(getDataText(1),true);
setTextFormatPattern(getDataText(1),"$#");
setTextFormatPreset(getDataText(1),6);
setDisplay(getO1MajorGrid(),false);
setScaleMax(getY1Axis(),100.0);
setGridStepAuto(getY1MajorGrid(),false);
setGridStep(getY1MajorGrid(),20.0);
*GRAPH_JS_FINAL
"agnosticSettings": {
"dual": true,
"chartTypeFullName": "Bar_Clustered_Dual_Axis"
}
*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, 2013
Thank you for that simplified code. Unfortunately, it did not work for us. It is sleek code though and extremely easy to follow.
As a workaround, we got the code to a point where our hovers work and have the appropriate signs. Additionally, the data labels appear above the bars as per our desired output. The labels just don't have any percentage or dollar signs appearing with them.
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET EMBEDHEADING ON
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 1
ON GRAPH SET LOOKGRAPH VBAR2AX
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
*END
INCLUDE=stylesheet here,
TYPE=REPORT, TITLETEXT='WebFOCUS Report', ORIENTATION=LANDSCAPE, $
TYPE=HEADING, JUSTIFY=LEFT, FONT='Calibri', SIZE=10, COLOR=RGB(0 0 0), STYLE=BOLD, $
TYPE=FOOTING, JUSTIFY=RIGHT, FONT='Calibri', SIZE=8, COLOR=RGB(0 0 0), STYLE=NORMAL, $
*GRAPH_SCRIPT
setUseSeriesShapes(true);
setMarkerSizeDefault(50);
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthAngle(45);
setPieTilt(10);
setPieDepth(70);
setDepthRadius(0);
setTextFormatPreset(getDataText(),0);
setDisplay(getY1Title(),false);
setFontName(getY1Label(),"Calibri");
setFontName(getY2Title(),"Calibri");
setFontName(getY2Label(),"Calibri");
setFontName(getDataText(),"Calibri");
setFontName(getO1Title(),"Calibri");
setFontName(getX1Title(),"Calibri");
setFontName(getSubtitle(),"Calibri");
setFontName(getAllText(),"Calibri");
setFontSizeAbsolute(getY2Title(),true);
setFontSizeInPoints(getY2Title(),9);
setPlaceResize(getY2Title(),0);
setFontStyle(getY2Title(),2);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeInPoints(getY1Label(),9);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeInPoints(getY2Label(),9);
setPlaceResize(getY1Label(),0);
setTextFormatPreset(getY1Label(),28);
setTextString(getY2Title(),"Dollars");
setDisplay(getY2Title(),false);
setTextFormatPreset(getY2Label(),-1);
setTextFormatPattern(getY2Label(),"$#");
setDisplay(getLegendArea(),false);
setDisplay(getLegendArea(),true);
setFontName(getLegendText(),"Calibri");
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),9);
setPlaceResize(getLegendText(),0);
setDataTextDisplay(true);
setDisplay(getDataText(),false);
setTextFormatPattern(getDataText(1),"$#");
setTextFormatPattern(getDataText(0),"#.#%");
setDisplay(getDataText(1), false);
setDisplay(getDataText(0),false);
setTextFormatPreset(getDataText(1),6);
setTextFormatPreset(getDataText(0),3);
setSeriesLabel(0,"Percent");
setSeriesLabel(1,"Dollars");
setAxisAssignment( $0, 0);
setAxisAssignment( $1, 1);
setDisplay(getO1MajorGrid(),false);
setGridStepAuto(getY2MajorGrid(),false);
setGridStep(getY2MajorGrid(),6)
setAltFmtFrameNumColors(getY2AltFmtFrame(),5);
setDisplay(getY1MajorGrid(),false);
setDisplay(getY1MajorGrid(),false);
setDisplay(getY2MajorGrid(),false);
setDisplay(getO1MajorGrid(),false);
setScaleMax(getY1Axis(),100.0);
setGridStepAuto(getY1MajorGrid(),false);
setGridStep(getY1MajorGrid(),20.0);
*END
ENDSTYLE
END
-*IA_GRAPH_FINISH
-RUN
The code you see above is what we used only after we started a blank chart with our data, accessed the text editor and replaced the formatting lines with the simplified code you provided in your most recent post. We also added the top part of your code in the SET GRAPH ENGINGE section.
What kept happening was that we could only get one or the other signs to appear in the data labels, but not both, even when using your simplified code. My teammate and colleague tried using your code, too, and he experienced the same results.
Originally posted by Doug: This leads me to ask: How can we get the value to be display 'On Hover' to match the value displayed at the top of the bars. In this example The values display On Hover are the same but missing the percent sign / currency symbol.
IMHO: The values displayed should be the same in all cases.
I do appreciate the use of the two 'setSeriesLabel' statements to show 'Dollars' and 'Percent'.
Then, I'll push this a bit and ask if it can be done within InfoAssist.