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've been tasked with making stacked bar charts that will include both the series label and the data value on the chart as a data label. So for the CAR example below, instead of just having the sales amount for each series it would also have the country like: "JAPAN: 78,030". This seems like a very simple task but I can't seem to find a way to do it. I can either display the data value or the series value but not both.
GRAPH FILE CAR
SUM CAR.BODY.SALES
BY CAR.ORIGIN.COUNTRY
BY CAR.BODY.BODYTYPE
WHERE CAR.BODY.BODYTYPE EQ 'SEDAN';
WHERE CAR.ORIGIN.COUNTRY NE 'ITALY';
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET AUTOFIT ON
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);
setPlace(true);
setCurveFitEquationDisplay(false);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.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, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDataTextPosition(4);
setDataTextDisplay(true);
setDisplay(getLegendArea(),false);
*GRAPH_JS_FINAL
"pieProperties": {
"holeSize": "0%"
},
"blaProperties": {
"seriesLayout": "stacked"
},
"agnosticSettings": {
"chartTypeFullName": "Bar_Stacked"
}
*END
ENDSTYLE
END
-RUN
This message has been edited. Last edited by: Matthew S,
GRAPH FILE CAR
SUM SALES
COMPUTE TT1 /A30V = 'My Tooltip';
COMPUTE TT2 /A30V = COUNTRY || ' : ' | FPRINT(SALES, 'D8', 'A10');
BY COUNTRY
BY BODYTYPE
WHERE BODYTYPE EQ 'SEDAN';
WHERE COUNTRY NE 'ITALY';
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET AUTOFIT ON
ON GRAPH SET UNITS PIXELS
ON GRAPH SET HAXIS 700
ON GRAPH SET VAXIS 400
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setPlace(true);
setCurveFitEquationDisplay(false);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.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=TT1, BUCKET=tooltip, $
TYPE=DATA, COLUMN=TT2, BUCKET=tooltip, $
*GRAPH_JS_FINAL
series: [ {"series": 'reset', "tooltip": '{{tooltip1}}<br>{{tooltip2}}'} ],
htmlToolTip: {enable: true, snap: false }
*END
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDataTextPosition(4);
setDataTextDisplay(true);
setDisplay(getLegendArea(),false);
*GRAPH_JS_FINAL
"pieProperties": {
"holeSize": "0%"
},
"blaProperties": {
"seriesLayout": "stacked"
},
"agnosticSettings": {
"chartTypeFullName": "Bar_Stacked"
}
*END
ENDSTYLE
END
-RUN
You can add as many as you want. Each tooltip will be on its own line.
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
In case you meant the data labels and not tooltips, here is another slant. This method can be found in the JSCHART manual (page 135 of the copy that I have) within chapter "4 Chart-Wide properties" under "Using a Callback Function to Format Data Labels".
My suggestion is to download a copy of the PDF for reference.
GRAPH FILE CAR
SUM SALES
COMPUTE TT1/A30V = COUNTRY || ' : ' | FPRINT(SALES, 'D8', 'A10');
BY COUNTRY
BY BODYTYPE
WHERE BODYTYPE EQ 'SEDAN';
WHERE COUNTRY NE 'ITALY';
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET AUTOFIT ON
ON GRAPH SET UNITS PIXELS
ON GRAPH SET HAXIS 700
ON GRAPH SET VAXIS 400
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setPlace(true);
setCurveFitEquationDisplay(false);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.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=TT1, BUCKET=tooltip, $
*GRAPH_JS_FINAL
dataLabels: {
visible: true,
position: 'bottom',
formatCallback: function(d) {return d.tooltip1;}
},
htmlToolTip: {enable: true, snap: false }
*END
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDisplay(getLegendArea(),false);
*GRAPH_JS_FINAL
"pieProperties": {
"holeSize": "0%"
},
"blaProperties": {
"seriesLayout": "stacked"
},
"agnosticSettings": {
"chartTypeFullName": "Bar_Stacked"
}
*END
ENDSTYLE
END
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
Nice works guys. If you know me, I'll do / ask for more. So, What needs to be done to eliminate "'SALES:' and 'COUNTRY:' from displaying in the tooltip (on hover)? It's redundant information.
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
Originally posted by Doug: Nice works guys. If you know me, I'll do / ask for more. So, What needs to be done to eliminate "'SALES:' and 'COUNTRY:' from displaying in the tooltip (on hover)? It's redundant information.
I did turn off tooltips but if for some reason they needed to be kept you could do something like: