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 have a bar chart with the left bar as the Grand Total. The middle and right bar are percentages of that total.
Below is an example of the chart and graph_script found on Focal Point that I"m trying to tweak. So far, it looks like, this.data[0] is storing the individual bar totals and adding them together as Total.
But to make this work, the Total must be based on the far left bar. The tool tip for that bar would say 100%.
Thank you in advance for looking.
*GRAPH_JS
-* Custom ToolTip
htmlToolTip: {
enabled: true,
-* snap: true,
style: {
border: 'thin solid blue',
background: '#b1ffff',
},
},
series: [
{ "series": 'reset',
"tooltip": function(d,s,g){
var valueArr = this.data[0],total=0;
for (var i=0 ;i<valueArr.length;i++){total+=valueArr[i];}
var sum= d / total * 100 ;
-*debugger;
return this.getSeries(s).label + " For " +this.getGroupLabel(g)+': '+ this.formatNumber(d, '&TOOLTIP_FORMAT.EVAL#,#')+ '<br>'+' Percent of Total ' +this.getSeries(s).label + ': '+sum.toFixed(1)+ "%";
}
},
]
-*,
-*"blaProperties": {
-*"seriesLayout": "absolute",
-*"orientation": "horizontal",
-*"barGroupGapWidth": .6
-*}
*END
This message has been edited. Last edited by: FP Mod Chuck,
Don, You can also create your own tooltip with the below technic. The graph result itself may make no sense, just for the technic.
TABLE FILE CAR
SUM RETAIL_COST/P8C AS 'MEASD'
COMPUTE MEASP /P8.2C = RETAIL_COST / DEALER_COST * 100;
BY COUNTRY AS 'DIM1'
BY CAR AS 'DIM2'
BY TOTAL COMPUTE DIM3 /A20V = COUNTRY || '-' || CAR;
ON TABLE HOLD AS GRAPHDATA
END
-RUN
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='400.0';
-DEFAULTH &WF_STYLE_WIDTH='500.0';
-DEFAULTH &WF_TITLE='Sample Tooltip';
GRAPH FILE GRAPHDATA
SUM MEASD AS ''
COMPUTE BYX /A30V = DIM3;
COMPUTE VALX /A40V = 'Measure Title : ' | FPRINT(MEASD, 'P8C', 'A10V');
COMPUTE PCTX /A40V = FPRINT(MEASP, 'P8.2C', 'A15V') || ' %';
BY DIM1 AS ''
BY DIM2 AS ''
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, $
TYPE=DATA, COLUMN=N1, BUCKET=color, $
TYPE=DATA, COLUMN=N2, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N3, BUCKET=y-axis, $
TYPE=DATA, COLUMN=BYX, BUCKET=tooltip, $
TYPE=DATA, COLUMN=VALX, BUCKET=tooltip, $
TYPE=DATA, COLUMN=PCTX, BUCKET=tooltip, $
*GRAPH_JS_FINAL
series: [ {"series": 'reset', "tooltip": '{{tooltip1}}<br>{{tooltip2}}<br>{{tooltip3}}'} ],
htmlToolTip: {enable: true, snap: false }
*END
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDisplay(getY1Title(),false);
setDisplay(getY1Label(),false);
setDisplay(getY1AxisLine(),false);
setLabelStagger(getO1Label(),true);
setLegendPosition(1);
setTextRotation(getO1Label(),3);
setMarkerShape(getAllSeries(),2);
*GRAPH_JS_FINAL
"xaxis": {
"title": {"visible": false}
},
"yaxis": {
"title": {"visible": false},
"majorGrid": {"ticks": {"visible": false}}
}
*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