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     [SOLVED]series_percent in pie chart label shows always 2 decimals instead of one
Go
New
Search
Notify
Tools
Reply
  
[SOLVED]series_percent in pie chart label shows always 2 decimals instead of one
 Login/Join
 
Gold member
posted
using series_percent in pie chart labels always shows 2 decimals instead of one. i tried using the default label formatting like below and it didnt respect it.

pie chart code:
----------------
setTextFormatPreset(getPieSliceLabel(),3);
.......
.......
.......
series: [
{series: 'reset', dataLabels: {content: '{{&|nbsp;&|nbsp;&|nbsp;&|nbsp;}} {{series_percent}} \n {{series_label}}' } } ]

label always shows like 10.10% though the data is 10.1% and its datatype is P12.1

anyone has idea to control the format in series_percent

-***************************************


update:
----------
currently i am experimenting like below using value instead of series_percent. will update in comments soon.

"series":[{"series": "reset",
"dataLabels":{"content":"{{value | formatNumber('$#,###.00')}}\n({{series_percent}})"}}],

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


WebFOCUS 8
Windows, All Outputs
 
Posts: 69 | Registered: January 23, 2018Reply With QuoteReport This Post
Gold member
posted Hide Post
update:

when i use "value" instead of "series_percent" i couldnt append the value with %. it converts the value to percent.

"series":[{"series": "reset",
"dataLabels":{"content":"{{value | '%'}}"],


WebFOCUS 8
Windows, All Outputs
 
Posts: 69 | Registered: January 23, 2018Reply With QuoteReport This Post
Master
posted Hide Post
This works for me
  
GRAPH FILE ibisamp/car
SUM CAR.BODY.SALES
BY CAR.ORIGIN.COUNTRY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT

setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
setCurveFitEquationDisplay(false); 
setPlace(true); 
setPieFeelerTextDisplay(1); 

*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/endeflt.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
TYPE=DATA, COLUMN=N1, BUCKET=color, $
TYPE=DATA, COLUMN=N2, BUCKET=measure, $
*GRAPH_SCRIPT

setReportParsingErrors(false);
setSelectionEnableMove(false);
setTransparentBorderColor(getSeries(*), true);
setPieLabelDisplay(5);
setTextFormatPreset(getPieSliceLabel(),3);
*GRAPH_JS_FINAL
"pieProperties": {
"holeSize": "0%"
},
"riserBevel": "none",
"agnosticSettings": {
"chartTypeFullName": "Pie_Pie"
}

*END
ENDSTYLE
END

-RUN


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Gold member
posted Hide Post
@hallway - i made it work this way, as i need some customization in the way the labels are displayed like values first followed by the label whereas webfocus by default doesn't have the functionality.
also i am able to concatenate the percent symbol without using pipe symbol.

i will close the case as below code help me resolve my need.

{series: 'reset', dataLabels: {content: '{{&|nbsp;&|nbsp;&|nbsp;&|nbsp;}} {{value}}% \n {{series_label}}' } } ]


WebFOCUS 8
Windows, All Outputs
 
Posts: 69 | Registered: January 23, 2018Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]series_percent in pie chart label shows always 2 decimals instead of one

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