Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Displaying data labels from different field in PNG Chart
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Displaying data labels from different field in PNG Chart
 Login/Join
 
Member
posted
Hi,

Has anyone plotted a chart using a numeric field but used a alphanumeric field to display the data labels? I have a line chart where I am plotting the average service time over several weeks. Average service time is a numeric field which contains the average service time in minutes with decimal places. I would like to display the average service time in minutes and seconds (mm:ss) format as the associated data label, is there a way to do that? While I can compute another field in alphanumeric format to show mm:ss, I was wondering if there was a way to use the computed field for the data label.

Is there a way to do this for a PNG chart as I am trying to reference the chart in a compound document?

Thank you in advance for your suggestions!
~JL
WebFOCUS 8.2.0.4

This message has been edited. Last edited by: FP Mod Chuck,
 
Posts: 2 | Registered: November 04, 2019Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Try this,
GRAPH FILE CAR
SUM SALES
COMPUTE TT1/A30V = 'HH:MM:SS'|| ' : ' | FPRINT(SALES, 'D8', 'A10');
-*COMPUTE TT1/A30V = COUNTRY || ' : ' | FPRINT(SALES, 'D8', 'A10');

BY COUNTRY

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:/WFC/Global/Themes/Standard/Default/theme.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $

TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $
TYPE=DATA, COLUMN=N2, 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
"series": [
{
"dataLabels": {
"clipToContainer": false,
"visible": true,
"color": "rgba(255, 255, 255, 1)",
"position": "center",
"content": "{{series_label}}, {{metadata_value(\"value\", \"dataLabels\")}}",
"font": "bold 7.5pt 'ARIAL'"
},
"series": "all"
}
],

"pieProperties": {
"holeSize": "0%"
},
"blaProperties": {
"seriesLayout": "stacked",
"orientation": "horizontal",
"barGroupGapWidth": 0.54
},

"agnosticSettings": {
"chartTypeFullName": "Bar_Stacked"
}
*END
ENDSTYLE
END


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
 
Posts: 246 | Location: Houston,TX | Registered: June 11, 2004Reply With QuoteReport This Post
Member
posted Hide Post
Thank you, vaayu.

Adding this worked for HTML5 chart:
dataLabels: {
visible: true,
position: 'bottom',
formatCallback: function(d) {return d.tooltip1;}
},

Is there anyway to get this to work for a PNG chart?

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


WebFOCUS 8.2.0.4
 
Posts: 2 | Registered: November 04, 2019Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Displaying data labels from different field in PNG Chart

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.