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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SHARING] How to add $ OR % sign in tooltip

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SHARING] How to add $ OR % sign in tooltip
 Login/Join
 
Virtuoso
posted
I have found the following regarding tooltip where several people are requesting to add the $ OR % sign.
The problem with that is, as per below sample, all tooltip have the same displayed format.
So if you have multiples columns in different format you are screwed.

For percentage numbers, it is not possible to use a custom format as for currency because IB apply the Custom Numeric Format Stings as defined at:
Custom Numeric Format Strings
and having a % sign added (such as '#.#%') result in having your value multiplied by 100 as stated in above link.

To add the $ sign in tooltip (assuming K $)
*GRAPH_JS
autoNumberFormats:{tooltip: '#,### $'}
*END


To add the % sign in tooltip
*GRAPH_JS
autoNumberFormats:{tooltip: function(n){ return n + ' %';}}
*END


Sample where % sign is displayed to ALL tooltip
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 /P6 = (RETAIL_COST - DEALER_COST) / DEALER_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);
*END

*GRAPH_JS
-*autoNumberFormats:{tooltip: '#,### $'}

autoNumberFormats:{tooltip: function(n){ return n + ' %';}}
*END

*GRAPH_JS_FINAL
"agnosticSettings": {
    "dual": true,
    "chartTypeFullName": "Bar_Clustered_Dual_Axis"
}
*END
ENDSTYLE
END
-RUN

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


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: 2410 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Virtuoso
posted Hide Post
Good One Thanks for sharing!


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2128 | Location: Customer Support | Registered: April 12, 2005Report 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     [SHARING] How to add $ OR % sign in tooltip

Copyright © 1996-2020 Information Builders