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     [CLOSED] Sorting Pie Chart by Percent

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Sorting Pie Chart by Percent
 Login/Join
 
Member
posted
Hello!

I'm having some difficulty sorting a pie chart by anything other than the BY field. Specifically, I'd like to sort by the percentage each piece occupies (so the largest piece, then second largest... down to the smallest).

For instance:
GRAPH FILE CAR
	HEADING CENTER
	"Model Count by Make"
	SUM CNT.MODEL
	BY CAR
	ON GRAPH PCHOLD FORMAT JSCHART
	ON GRAPH SET LOOKGRAPH PIE
 
ON GRAPH SET STYLE *

*GRAPH_SCRIPT
setPieSorting(2);
setPieFeelerTextDisplay(1); 
*END

ENDSTYLE

END


I thought setPieSorting would address my need, but it doesn't seem to do anything. Is there a way to sort pie graphs by either percent or value?

Thanks!
Jay

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.1/8.2, Windows 10/Server 2012
 
Posts: 24 | Location: Baltimore, MD | Registered: April 30, 2019Report This Post
Virtuoso
posted Hide Post
  
GRAPH FILE ibisamp/car
SUM CNT.MODEL
BY TOTAL HIGHEST CNT.MODEL NOPRINT
BY CAR
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
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/Warm.sty,$
TYPE=DATA, COLUMN=N1, BUCKET=color, $
TYPE=DATA, COLUMN=N2, BUCKET=color, $
TYPE=DATA, COLUMN=N3, BUCKET=measure, $
*GRAPH_SCRIPT

setReportParsingErrors(false);
setSelectionEnableMove(false);
*GRAPH_JS_FINAL
"pieProperties": {
"holeSize": "0%"
},
"agnosticSettings": {
"chartTypeFullName": "Pie_Pie"
}

*END
ENDSTYLE
END

-RUN


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Member
posted Hide Post
Thank you for the response! I can't get your code to run as is, because Warm.sty isn't saved at that address as far as I can tell, and I can't find it. When I swap that style out with one I know works, I get a pie chart with 7 identically sized slices with a value of 1.

Any thoughts on what my app may be doing wrong in this?


WebFOCUS 8.1/8.2, Windows 10/Server 2012
 
Posts: 24 | Location: Baltimore, MD | Registered: April 30, 2019Report This Post
Virtuoso
posted Hide Post
What version are you running? The code runs in my environment even when you comment out the style line. However, if you have InfoAssist, you should be able to create the same code in your version. Create a pie chart with CNT.MODEL as the measure and Color by CAR. Then right click CNT.MODEL in the query and click Sort, Descending. That ought to create a BY TOTAL CNT.MODEL NOPRINT in your code. See if that works.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Member
posted Hide Post
quote:
Originally posted by Jay Ervin:
Thank you for the response! I can't get your code to run as is, because Warm.sty isn't saved at that address as far as I can tell, and I can't find it. When I swap that style out with one I know works, I get a pie chart with 7 identically sized slices with a value of 1.

Any thoughts on what my app may be doing wrong in this?


Some more detail... I'm pretty sure the 7 pieces are the 7 car makes with only 1 model, so its excluding the 3 makes with 2+ models. The lines
TYPE=DATA, COLUMN=N1, BUCKET=color, $
TYPE=DATA, COLUMN=N2, BUCKET=color, $
TYPE=DATA, COLUMN=N3, BUCKET=measure, $

seems to enable/ disable 3 other pie charts, each with one car make, and each with a different model count.

Also, I'm working out of 8.1 if that makes a difference here.


WebFOCUS 8.1/8.2, Windows 10/Server 2012
 
Posts: 24 | Location: Baltimore, MD | Registered: April 30, 2019Report This Post
Virtuoso
posted Hide Post
I don't believe BUCKET syntax existed in 8.1. If you have an 8.2 test environment, that's where this will work.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Member
posted Hide Post
I think I'm a few days away from our 8.2 DEV environment being up and running. I'll give it a try then.

Thanks for your help!


WebFOCUS 8.1/8.2, Windows 10/Server 2012
 
Posts: 24 | Location: Baltimore, MD | Registered: April 30, 2019Report 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     [CLOSED] Sorting Pie Chart by Percent

Copyright © 1996-2020 Information Builders