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.

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.


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

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[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: 71 | Registered: January 23, 2018Report 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: 71 | Registered: January 23, 2018Report 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, 2015Report 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: 71 | Registered: January 23, 2018Report 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     [SOLVED]series_percent in pie chart label shows always 2 decimals instead of one

Copyright © 1996-2020 Information Builders