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     [SHARING] Detach Largest Pie Slice

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SHARING] Detach Largest Pie Slice
 Login/Join
 
Member
posted
I've got a request to create a Pie Chart where the largest value slice is detached from the rest of the pie. I've tried setting the Series 0 slice as the detached slice, but graphs sort alphabetically A to Z, Z to A or alternating large & small (I'm assuming that setPieSorting is the only available sort command).

I tried putting an &variable in my setPieSliceDetach(getSeries(&RANKVAR),100) line, which allowed me to manually select the pie slice to detach, but I just wasn't able to figure out a way to populate the &variable programatically.

Using GGSALES as the data source, I tried to Rank Highest Dollars By Product in HOLD1, re-sort HOLD1 BY Product then BY Rank to HOLD2, then tried to come up with a REPEAT LOOP scheme to figure out which line number in HOLD 2 contained the Rank of 1 (my highest value). If I could capture that line number, I could then pass that as &RANKVAR to my setPieSliceDetach(getSeries(&RANKVAR),100) line, and I would be a winner.

If you can help me capture the line number, that would be wonderful. If you have a better method for identifying the largest value slice and detaching it, by all means let me know.

If it helps, here is my code for the first two HOLD files:

APP HOLD BASEAPP

TABLE FILE GGSALES
SUM
DOLLARS
BY CATEGORY
RANKED AS 'RANK' BY TOTAL HIGHEST DOLLARS NOPRINT
BY PRODUCT
WHERE CATEGORY EQ 'Gifts';
ON TABLE HOLD AS HOLD1 FORMAT FOCUS
END

TABLE FILE HOLD1
PRINT DOLLARS
BY CATEGORY
BY PRODUCT
BY RANK
-*ON TABLE HOLD AS HOLD2 FORMAT FOCUS
END

This message has been edited. Last edited by: Kerry,
 
Posts: 5 | Registered: June 09, 2004Report This Post
Expert
posted Hide Post
It will always be the first one because of your BY HIGHEST sort.
TABLE FILE GGSALES
SUM
DOLLARS
BY CATEGORY
RANKED AS 'RANK' BY TOTAL HIGHEST DOLLARS NOPRINT
BY PRODUCT
WHERE CATEGORY EQ 'Gifts';
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END

TABLE FILE HOLD1
PRINT DOLLARS
BY CATEGORY
BY PRODUCT
BY RANK
WHERE RANK EQ 1
END

You can always put the data from the second request in a save file and the -READ to populate your amper variables.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Gold member
posted Hide Post
The example below produces bars but the principle is tha same.
TABLE FILE CAR
SUM SALES/D20.2
BY COUNTRY
ON TABLE HOLD AS TEMPCAR
END
-RUN
 
TABLE FILE TEMPCAR
SUM SALES/D20.2
RANKED BY HIGHEST SALES
BY COUNTRY
ON TABLE HOLD AS TEMPCAR1
END
GRAPH FILE TEMPCAR1
SUM SALES
BY RANK
BY COUNTRY
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB ON
ON GRAPH SET 3D ON
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH SET VAXIS 400
ON GRAPH SET HAXIS 800
ON GRAPH SET GRMERGE ON
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setY1LabelRotate(3);
setDataTextFormat(1);
setDataTextDisplay(true);
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(false);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setTextJustHoriz(getO1Title(),1);
setFontSizeAbsolute(getO1Title(),true);
setFontSize(getO1Title(),12);
setTextRotation(getO1Title(),0);
setTextWrap(getO1Title(),false);
setTextRotation(getO1Label(),3);
setPlaceResize(getO1Title(),0);
setPlaceRotate(getO1Title(),0);
setPlaceAlign(getO1Title(),0);
setPlaceWordWrap(getO1Title(),0);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
     PAGESIZE='Letter',
     LEFTMARGIN=0.250000,
     RIGHTMARGIN=0.250000,
     TOPMARGIN=0.250000,
     BOTTOMMARGIN=0.250000,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
     COLOR=RGB(255 224 193),
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
TYPE=HEADING,
     LINE=1,
     JUSTIFY=CENTER,
$
TYPE=HEADING,
     LINE=1,
     OBJECT=TEXT,
     ITEM=1,
     FONT='ARIAL',
     SIZE=12,
     COLOR='BLACK',
     STYLE=BOLD,
$
TYPE=HEADING,
     LINE=2,
     JUSTIFY=CENTER,
$
TYPE=HEADING,
     LINE=2,
     OBJECT=TEXT,
     ITEM=1,
     FONT='ARIAL',
     COLOR='BLACK',
     STYLE=BOLD,
$
TYPE=HEADING,
     LINE=3,
     JUSTIFY=CENTER,
$
TYPE=HEADING,
     LINE=3,
     OBJECT=TEXT,
     ITEM=1,
     FONT='ARIAL',
     COLOR='BLACK',
     STYLE=BOLD,
$
TYPE=HEADING,
     LINE=4,
     JUSTIFY=CENTER,
$
TYPE=HEADING,
     LINE=4,
     OBJECT=TEXT,
     ITEM=1,
     FONT='ARIAL',
     COLOR='BLACK',
     STYLE=BOLD,
$
ENDSTYLE
END
  


WF 7703M, XP/Win7, MRE, RC, BID, PMF, HTML, PDF, Excel 2000/7/10
 
Posts: 73 | Location: NY | Registered: February 06, 2007Report This Post
Member
posted Hide Post
Alex,

If you can translate your technique to a Pie Graph, I may be able to use it but, as far as I can see, I can only use 1 BY statement in my Pie Graph, and your example us using 2 BY statements. (Concatenating Rank and Fieldname might work, but I would prefer to use just the field names).

Ginny,

Could you give me an example of code for your -READ suggestion? And then continue that example poopulate my amper variable?

Glad to see you're still hanging out in the world of WebFOCUS!

Thanks,
Rich
 
Posts: 5 | Registered: June 09, 2004Report This Post
Expert
posted Hide Post
Rich,

I'm kinda sleepy this afternoon so don't want to re-invent the wheel. Here is a post I made awhile back where I sorted and graphed the data by one column, in your case RANK, but displayed another column on the graph.

Sorting by one and graphing the other


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Gold member
posted Hide Post
There is really nothing to translate. Just delete all of the chart section of the code and create a pie chart from the last hold file.


WF 7703M, XP/Win7, MRE, RC, BID, PMF, HTML, PDF, Excel 2000/7/10
 
Posts: 73 | Location: NY | Registered: February 06, 2007Report This Post
Member
posted Hide Post
AlexU,

Does it work for you when you delete the chart section of the code and create a pie chart? If so, could you post the code?

In your Bar chart example, you have BY Rank BY Country. In a Pie Chart, I can use only one BY, either Rank OR Country. If I use BY Rank, I know that the first slice is the largest, but I don't know the Country name, if I use BY Country, then my data is sorted alphabetically, and I am back where I started - unable to determine which pie slice has the largest value.

Ginny, Unless I can get AlexU's working example, I will also continue to play with your code to see if I can cobble it into my code. Thanks.
 
Posts: 5 | Registered: June 09, 2004Report This Post
Gold member
posted Hide Post
My suggestion to you is to stop playing with code, open up the chart editor in Dev Studio and create whatever kind of chart you want from the hold file. To get what you want exactly you might have to make some changes in the hold file generation or create a define but the basic way to rank order your data for a chart is the way I laid out. I'm sure there are more complex ways to do this by coding but the DS painter works well.


WF 7703M, XP/Win7, MRE, RC, BID, PMF, HTML, PDF, Excel 2000/7/10
 
Posts: 73 | Location: NY | Registered: February 06, 2007Report This Post
Member
posted Hide Post
AlexU,

To this point, I have been unsuccessful in both the GUI and the code.

From your responses so far, it does not appear that you have tried to do this yourself. If you have, then please post the steps you took (or post the code, whichever is easier). If not, please try it, and when successful, send me the code/steps for completion.

Thanks,
Rich
 
Posts: 5 | Registered: June 09, 2004Report 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     [SHARING] Detach Largest Pie Slice

Copyright © 1996-2020 Information Builders