Focal Point
[SOLVED] Graph PieChart Group by "Not in top 5" trouble

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5157007276

September 17, 2014, 10:17 AM
SarahS
[SOLVED] Graph PieChart Group by "Not in top 5" trouble
I am creating a pie chart that needs to show the top 5 results and then group the rest of the results into its own slice. I have tried using OtherSeries on this and its not working. It doesn't group them at all. Any help would be appreciated.

GRAPH FILE LOAN_EXC

SUM LOAN_EXC.LOAN_EXC.FAILURE_COUNT AS "Failure Count"
BY LOAN_EXC.LOAN_EXC.DYNAMIC_ERROR_MESSAGE_TXT AS "Error"

ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH PIEMULTI
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setGraphType(55);
setOtherSeries(true);
setOtherPercentage(10.0);
value = getOtherPercentage();
setDisplay(getPieOtherFrame(),true);
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setPieFeelerTextDisplay(1);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT='WebFOCUS Report', $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*END
ENDSTYLE
END
-*IA_GRAPH_FINISH

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8.02
Windows, All Outputs
September 18, 2014, 09:36 AM
Shakila Subhan
With the PLUS OTHERS phrase, you can aggregate all other values to a separate group and display this group as an additional report row.

GRAPH FILE CAR
SUM DEALER_COST 
  BY HIGHEST 5 CAR
  PLUS OTHERS AS 'Others'
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH PIEMULTI
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setGraphType(55);
setOtherSeries(true);
setOtherPercentage(10.0);
value = getOtherPercentage();
setDisplay(getPieOtherFrame(),true);
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
setCurveFitEquationDisplay(false); 
setPlace(true); 
setPieFeelerTextDisplay(1); 
*END
TYPE=REPORT, TITLETEXT='WebFOCUS Report', $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*END
ENDSTYLE
END




WebFOCUS 8.0.08 - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5
Windows, All Outputs
September 18, 2014, 09:45 AM
<nick z>
Hi,
OtherSeries will not work in JSCHART format.
You would have to use JSON code.
Here is an example of adding otherSlice in JSCHART output format:

ENGINE INT CACHE SET ON

GRAPH FILE CAR
-* Created by Info Assist for Graph
SUM SALES
BY MODEL
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET ARGRAPHENGIN JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH PIEMULTI
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT

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

*END

*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*END
*GRAPH_JS
dataLabels: {visible:true},
pieProperties: {otherSlice:
{threshold: '7%',
legendLabel: 'OTHER',
color: 'blue',
}
},
legend: {visible:true},
interaction:{
click: 'otherSliceDrillDown'
} ,

*END
ENDSTYLE
END

-RUN
September 22, 2014, 02:28 PM
SarahS
Fantastic! Thanks for the great advice Smiler


WebFOCUS 8.02
Windows, All Outputs