How do I change the sorting order on a stacked bar graphs (regular/dual-axis) based on a BY and ACROSS combination. Example with CAR file below:
TABLE FILE CAR SUM SALES ACROSS COUNTRY BY BODYTYPE END
GRAPH FILE CAR SUM SALES ACROSS COUNTRY BY BODYTYPE ON GRAPH SET LOOKGRAPH VBRSTK1 ON GRAPH SET GRAPHEDIT SERVER ON GRAPH SET BARNUMB OFF ON GRAPH SET 3D OFF ON GRAPH SET VZERO ON ON GRAPH SET GRID ON ON GRAPH SET GRMERGE ON ON GRAPH PCHOLD FORMAT JPEG ON GRAPH SET GRAPHSTYLE * setMarkerDisplay(true); setConnectLineMarkers(false); setConnectScatterMarkers(false); setO1LabelDisplay(true); setO1AxisSide(0); setO1MajorGridDisplay(true); setO1MajorGridStyle(0); setO1MinorGridDisplay(false); setAxisAssignment(0,0); setSeriesType(0,1); setY1LabelDisplay(true); setY1AxisSide(0); setY1MajorGridDisplay(true); setY1MajorGridStyle(0); setY1MinorGridDisplay(false); setTextFormatPreset(getY1Label(),-1); setTextFormatPattern(getY1Label(),"#.##"); setPieFeelerTextDisplay(1); setPieLabelDisplay(0); setTextFormatPreset(getPieSliceLabel(),1); setRiserBorderMode(1); setSeriesDefaultTransparentBorderColor(true); setUseSeriesBorderDefaults(true); setLegendDisplay(true); setFontSizeAbsolute(getY1Title(),true); setFontSizeAbsolute(getY1Label(),true); setFontSizeAbsolute(getY2Title(),true); setFontSizeAbsolute(getY2Label(),true); setFontSizeAbsolute(getO1Title(),true); setPlace(true); ENDSTYLE ON GRAPH SET STYLE * SQUEEZE=ON, ORIENTATION=PORTRAIT, $ TYPE=REPORT, GRID=OFF, FONT='TIMES NEW ROMAN', SIZE=10, $ TYPE=HEADING, LINE=1, OBJECT=FIELD, ITEM=1, COLOR='BLACK', $ ENDSTYLE END
Need to be sorted by sales descending, from W GERMANY to FRANCE.
Thanks for your help.This message has been edited. Last edited by: dballest,
Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10 QA: WebFOCUS 7.6.10, Data Migrator 7.6.10 Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8 Windows 2K3, Tomcat 5.5.17, IIS 6 Usage: HTML, PDF, Excel, Self-serve, BID and MRE
October 07, 2008, 02:11 AM
Mika Keranen
Hi,
I've used the following technique to create this kind of graphs. The idea is to create a HOLD/SAVE file with key values and use a dialogue manager READ loop to organize the graph using ACROSS with COLUMNS. Haven't used the latest graph tools that much (yet , so don't know would there be any settings to achieve this.
Hope this helps. Mika
TABLE FILE CAR
BY HIGHEST TOTAL SALES NOPRINT
BY COUNTRY
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE
END
-RUN
-SET &Cntr = &LINES ;
GRAPH FILE CAR
SUM SALES
ACROSS COUNTRY
COLUMNS
-REPEAT :DoCols FOR &i FROM 1 TO &Cntr
-READ SAVE &Country.A10.
-SET &And = IF &i EQ &Cntr THEN '' ELSE 'AND' ;
'&Country' &And
-:DoCols
BY BODYTYPE
ON GRAPH SET LOOKGRAPH VBRSTK1
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
etc ...
WebFOCUS 7.6.x PMF 5.2.x
October 07, 2008, 11:43 AM
dballest
Thanks Mika. That did work.
Dan
Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10 QA: WebFOCUS 7.6.10, Data Migrator 7.6.10 Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8 Windows 2K3, Tomcat 5.5.17, IIS 6 Usage: HTML, PDF, Excel, Self-serve, BID and MRE