Focal Point
[SOLVED]Pie graph sorting

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

January 04, 2010, 11:29 AM
CT
[SOLVED]Pie graph sorting
I have a pie graph which needs to be sorted by one field and display a different field as legend.
HDSTAT1 is defined as;
   
 dataStatusID                      E01           I11         MISSING = ON
 dataStatusName                    E02           A100        MISSING = ON
 statusCount                       E03           I11         MISSING = ON
 sortOrder                         E04           I11


I need to sort the graph by sortOrder, but display the corresponding dataStatusName as legend.
I have looked at all realted Focal Point posts. Some suggests to concatenate % value before the legend item name which we are already doing in other graphs.
In this case we do not want to show the sort order, just use it to sort the graph. I tried through AGA tool as well as manually changing the code. I think this may be an enhancement request for IBI. Really appreciate if you could suggest any other solution.
Thank you.

 
GRAPH FILE HDSTAT1
-* Created by Advanced Graph Assistant
SUM HDSTAT1.HDSTAT1.statusCount
BY HDSTAT1.HDSTAT1.dataStatusName
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIESINGL
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 0
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(5);
setTransparentBorderColor(getSeries(0),true);
setTransparentBorderColor(getSeries(1),true);
setTransparentBorderColor(getSeries(2),true);
setTransparentBorderColor(getSeries(3),true);
setTransparentBorderColor(getSeries(4),true);
setTransparentBorderColor(getSeries(5),true);
setTransparentBorderColor(getSeries(6),true);
setTransparentBorderColor(getSeries(7),true);
setTransparentBorderColor(getSeries(8),true);
setTransparentBorderColor(getSeries(9),true);
setTransparentBorderColor(getSeries(10),true);
setPieDepth(10);
setTransparentBorderColor(getChartBackground(),true);
setPlace(true);
setPieFeelerTextDisplay(0);
ENDSTYLE
END
-RUN

  
  

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


7.6.9, XP
January 05, 2010, 06:22 AM
<JG>
Need to look just a little harder

http://forums.informationbuild...831048331#7831048331
January 05, 2010, 10:15 AM
VLozovsky
Hello,

Try adding a BY NOPRINT field that you want to sort the graph by, but no show on the legend.

I would suggest the following:

GRAPH FILE HDSTAT1
-* Created by Advanced Graph Assistant
SUM HDSTAT1.HDSTAT1.statusCount
BY SortOrder NOPRINT
BY HDSTAT1.HDSTAT1.dataStatusName
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIEMULTI
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(5);
setTransparentBorderColor(getSeries(0),true);
setTransparentBorderColor(getSeries(1),true);
setTransparentBorderColor(getSeries(2),true);
setTransparentBorderColor(getSeries(3),true);
setTransparentBorderColor(getSeries(4),true);
setTransparentBorderColor(getSeries(5),true);
setTransparentBorderColor(getSeries(6),true);
setTransparentBorderColor(getSeries(7),true);
setTransparentBorderColor(getSeries(8),true);
setTransparentBorderColor(getSeries(9),true);
setTransparentBorderColor(getSeries(10),true);
setPieDepth(10);
setTransparentBorderColor(getChartBackground(),true);
setPlace(true);
setPieFeelerTextDisplay(0);
ENDSTYLE
END
-RUN
January 06, 2010, 11:10 AM
CT
JG and VLozovsky,
your solution works for other graph types, but not for pie graphs. I tried thru Advanced graph tool as well adding additional BY field with NOPRINT thru code. The tool doesn't doesn't let you have two BY fields. If you manually change the code, you get an error, (FOC32466) MERGE DIMENSIONS EXCEED THE NUMBER OF SORT FIELDS.
Thanks.


7.6.9, XP
January 06, 2010, 12:25 PM
Tom Flynn
? 32466
-EXIT

Self-explanatory...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
January 06, 2010, 01:12 PM
CT
Tom,
Thank you so much. I fixed the graph as suggested in the message and it works great! I really appreciate that. Also, you showed me a way to get description for errors
quote:
? 32466

Thanks again.


7.6.9, XP
January 06, 2010, 01:41 PM
Tom Flynn
CT,

You're welcome. Some messages are great, some, not so much.

Have Fun! Smiler


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe