GRAPH Tips and Techniques

advertisement
GRAPH Tips and Techniques
Renee Teatro
Information Builders
Copyright 2007, Information Builders. Slide 1
GRAPH Tips and Techniques
Agenda
 HEADING vs. setTitleString()
 Generate a specific number of Pie Graphs per row
 Quadrant Lines via setReferenceLine()
 Axis and Data Format Options
 Reset Max and Min Scale Options
 Bar and Line Graph
 Sort Graph by a Different Value from Display Value
GRAPH Tips and Techniques
Field References in HEADING of GRAPH
DEFINE FILE CAR
YR/A4=IF EDIT(CAR,'$9') EQ 'E' THEN '2006' ELSE '2007';
END
GRAPH FILE CAR
HEADING
"
<YR"
SUM RCOST AS 'Net,Sales,Amt,(USD)'
ACROSS COUNTRY
BY YR
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET GRID ON
ON GRAPH SET VAXIS 200
ON GRAPH SET HAXIS 200
ON GRAPH SET GRAPHSTYLE *
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,
SIZE=12,
COLOR='BLACK',
STYLE=BOLD,
$
ENDSTYLE
END
GRAPH Tips and Techniques
Field References in HEADING of GRAPH – HOLD Graph
APP HOLD BASEAPP
DEFINE FILE CAR
YR/A4=IF EDIT(CAR,'$9') EQ 'E' THEN '2006' ELSE '2007';
END
GRAPH FILE CAR
HEADING
"
<YR"
SUM RCOST AS 'Net,Sales,Amt,(USD)'
ACROSS COUNTRY
BY YR
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET GRID ON
ON GRAPH SET VAXIS 200
ON GRAPH SET HAXIS 200
ON GRAPH HOLD FORMAT GIF
ON GRAPH SET GRAPHSTYLE *
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,
SIZE=12,
COLOR='BLACK',STYLE=BOLD,
$
ENDSTYLE
END
hold0.gif:
hold1.gif:
GRAPH Tips and Techniques
Utilize setTitleString() with &variable for Graph Title
GRAPH FILE CAR
SUM RCOST AS 'Net,Sales,Amt,(USD)'
ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET GRID ON
ON GRAPH SET VAXIS 200
ON GRAPH SET HAXIS 200
ON GRAPH SET GRAPHSTYLE *
setPlace(true);
setTitleString("Graph Title String");
setSubtitleString("Graph Subtitle String");
setFootnoteString("Graph Footnote String");
ENDSTYLE
END
NOTE: setTitleString() is displayed
even if the graph is held, unlike
HEADING
GRAPH Tips and Techniques
Utilize setTitleString() with &variable for Graph Title
setFontStyle() - This method assigns a font style to a text object.
setFontStyle(int newValue);
setFontStyle(IdentObj id, int newValue);
Some Object IDs are
id - Is an object ID returned by a getObjectID() method (for example, getTitle()).
newValue - Is the font style (0...7). Values can be:
0 = Plain
1 = Italic
2 = Bold
3 = Italic/Bold
4 = Underline
5 = Italic/Underline
6 = Bold/Underline
7 = Bold/Italic/Underline
setFontSizeInPoints() - This method assigns a font size to a text object.
setFontSizeInPoints (int newValue);
setFontSizeInPoints (IdentObj id, int newValue);
id - Is an object ID returned by a getObjectID() method (for example, getTitle())
newValue - Is a font size value in points (1...128). The default value is 12.
setFontName() - This method assigns a font name to a text object.
setFontName(String newValue);
setFontName(IdentObj id, String newValue);
id - Is an object ID returned by a getObjectID() method (for example, getFootnote()).
newValue - Is a font name string.
getFootnote()
getLegendText()
getSubtitle()
getTitle()
GRAPH Tips and Techniques
Utilize setTitleString() with &variable for Graph Title
APP HOLD BASEAPP
DEFINE FILE CAR
YR/A4=IF EDIT(CAR,'$9') EQ 'E' THEN '2006' ELSE '2007';
END
TABLE FILE CAR
BY YR
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS YRVALS
END
-RUN
-SET &CTR=0;
-LOOPIT
-READ YRVALS NOCLOSE &YR.A4.
-SET &PDFGNAME='PDFG'||&CTR;
-SET &CTR=&CTR + 1;
-IF &IORETURN NE 0 GOTO ENDIT;
GRAPH FILE CAR
SUM RCOST AS 'Net,Sales,Amt,(USD)'
ACROSS COUNTRY COLUMNS ENGLAND OR FRANCE OR ITALY OR
JAPAN OR 'W GERMANY'
BY YR
WHERE YR EQ '&YR'
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET GRID ON
ON GRAPH SET VAXIS 500
ON GRAPH SET HAXIS 400
ON GRAPH HOLD AS &PDFGNAME.EVAL FORMAT GIF
ON GRAPH SET GRAPHSTYLE *
setTitleString("&YR");
setFontSizeAbsolute(getTitle(), true);
setFontSizeInPoints(getTitle(), 14);
setFontStyle(getTitle(),2);
setFontName(getTitle(),"Courier New");
-*setFontSizeAbsolute(getTitle(), false);
-*setFontSizeVC(getTitle(), 800);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
SQUEEZE=ON,
ORIENTATION=PORTRAIT,$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,$
ENDSTYLE
END
-RUN
-GOTO LOOPIT;
-ENDIT
GRAPH Tips and Techniques
Utilize setTitleString() with &variable for Graph Title
pdfg0.gif:
pdfg1.gif:
GRAPH Tips and Techniques
Display 3 Pies in a single row using PIEMULTI
GRAPH FILE CAR
SUM BHP
RPM
MPG
ACROSS CAR
WHERE ( CAR EQ 'TOYOTA' ) OR ( CAR EQ 'JENSEN' ) OR ( CAR EQ 'TRIUMPH' );
ON GRAPH SET LOOKGRAPH PIEMULTI
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D ON
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
END
GRAPH Tips and Techniques
Display 3 Pies in a single row using PIEMULTI
GRAPH FILE CAR
SUM BHP
RPM
MPG
ACROSS CAR
WHERE ( CAR EQ 'TOYOTA' ) OR ( CAR EQ 'JENSEN' ) OR ( CAR EQ 'TRIUMPH' );
ON GRAPH SET LOOKGRAPH PIEMULTI
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D ON
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH SET GRAPHSTYLE *
setPiesPerRow(3);
ENDSTYLE
END
GRAPH Tips and Techniques
Display Graph Data in Quadrants via setReferenceLine()
GRAPH FILE SRC1
PRINT TOTAL_COST AS '' ITEMWAREHOUSE_KEY
ACROSS ONHAND
ON GRAPH SET LOOKGRAPH SCATTERS
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET GRID ON
ON GRAPH SET VAXIS 650
ON GRAPH SET HAXIS 900
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setFillColor(getLegendArea(),new Color(180,12,54));
setMarkerDisplay(false);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setX1LabelDisplay(true);
setX1AxisSide(0);
setX1ExcludeMinLabel(true);
setX1ExcludeMaxLabel(true);
setFillMissingData(0);
setX1MajorGridDisplay(true);
setX1MajorGridStyle(0);
setX1MinorGridDisplay(false);
setAxisAssignment(0,0);
setAxisAssignment(1,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1LogScale(true);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),8);
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setTextFormatPreset(getX1Label(),7);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(false);
setTitleString("TOTAL COST BY ONHAND QUANTITY for BUY
ITEMS");
setFontName(getTitle(),"Dialog");
setFontSizeAbsolute(getTitle(),true);
setFontStyle(getTitle(),3);
setFillColor(getTitle(),new Color(255,255,255));
setTextJustHoriz(getY1Title(),1);
setFontSizeAbsolute(getY1Title(),true);
setFontSize(getY1Title(),12);
setTextRotation(getY1Title(),1);
setTextWrap(getY1Title(),false);
setTextJustHoriz(getY1Label(),1);
setFontName(getY1Label(),"Dialog");
setFontSizeAbsolute(getY1Label(),true);
setFontSize(getY1Label(),12);
setFontStyle(getY1Label(),2);
setFillColor(getY1Label(),new Color(255,255,255));
setTextRotation(getY1Label(),3);
setTextWrap(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setTextJustHoriz(getX1Title(),1);
setFontSizeAbsolute(getX1Title(),true);
setFontSize(getX1Title(),12);
setFillColor(getX1Title(),new Color(255,255,255));
setTextRotation(getX1Title(),0);
setTextWrap(getX1Title(),false);
setTextJustHoriz(getX1Label(),1);
setFontSizeAbsolute(getX1Label(),true);
setFontSize(getX1Label(),12);
setFontStyle(getX1Label(),2);
setFillColor(getX1Label(),new Color(255,255,255));
setTextRotation(getX1Label(),3);
setTextWrap(getX1Label(),true);
setPlaceResize(getY1Title(),0);
setPlaceRotate(getY1Title(),0);
setPlaceAlign(getY1Title(),0);
setPlaceWordWrap(getY1Title(),0);
setPlaceResize(getY1Label(),0);
setPlaceRotate(getY1Label(),0);
setPlaceAlign(getY1Label(),0);
setPlaceWordWrap(getY1Label(),0);
setPlaceResize(getX1Title(),0);
setPlaceRotate(getX1Title(),0);
setPlaceAlign(getX1Title(),0);
setPlaceWordWrap(getX1Title(),0);
setPlaceResize(getX1Label(),0);
setPlaceRotate(getX1Label(),0);
setPlaceAlign(getX1Label(),0);
setPlaceWordWrap(getX1Label(),0);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
PAGESIZE='Letter',
LEFTMARGIN=0.000000,
RIGHTMARGIN=0.000000,
TOPMARGIN=0.000000,
BOTTOMMARGIN=0.000000,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
COLOR='WHITE',
BACKCOLOR=RGB(180 12 54),
STYLE=NORMAL,
RIGHTGAP=0.000000,
$
ENDSTYLE
END
GRAPH Tips and Techniques
Display Graph Data in Quadrants via setReferenceLine()
GRAPH Tips and Techniques
Display Graph Data in Quadrants via setReferenceLine()
setReferenceLine() - This method defines a reference line to be drawn in the graph.
setReferenceLine(IdentObj axisObj, int nIndex, double nPosition)
axisObj - Is an object ID of an axis object returned by a getObjectID() method (for example,
getY1Axis()).
nIndex - Is the reference line index number (0...2).
nPosition - Is the reference line position.
setLineWidth() - This method defines the thickness (in pixels) of a line object.
setLineWidth(IdentObj id,int newValue);
setLineWidth(int newValue);
id - Is an object ID returned by a getObjectID() method (for example, getReferenceLine ()).
newValue - Is the line width in pixels.
setFillColor() - This method assigns a fill color to an area object.
setFillColor(Color newValue);
setFillColor(IdentObj id, Color newValue);
id - Is an object ID returned by a getObjectID() method (for example, getReferenceLine()).
newValue - Is the value of the fill color.
GRAPH Tips and Techniques
Display Graph Data in Quadrants via setReferenceLine()
TABLE FILE SRC1
SUM AVE.TOTAL_COST AVE.ONHAND
ON TABLE SAVE AS SRCAVGS
ON TABLE SET HOLDLIST PRINTONLY
END
-RUN
-READ SRCAVGS &AVETOTCST.A12. &AVEONHAND.A9.
-TYPE AVETOTCST=&AVETOTCST
-TYPE AVEONHAND=&AVEONHAND
-RUN
GRAPH FILE SRC1
PRINT TOTAL_COST AS '' ITEMWAREHOUSE_KEY
ACROSS ONHAND
ON GRAPH SET LOOKGRAPH SCATTERS
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET GRID ON
ON GRAPH SET VAXIS 650
ON GRAPH SET HAXIS 900
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
-*Section of code added to create reference lines based on average values
-*to create a 4 quadrant output
setReferenceLine(getY1Axis(),0,&AVETOTCST);
setLineWidth(getReferenceLine(getY1Axis(),0),3);
setFillColor(getReferenceLine(getY1Axis(),0),new Color(255,0,0));
setReferenceLine(getX1Axis(),0,&AVEONHAND);
setLineWidth(getReferenceLine(getX1Axis(),0),3);
setFillColor(getReferenceLine(getX1Axis(),0),new Color(255,0,0));
-*
…
GRAPH Tips and Techniques
Display Graph Data in Quadrants via setReferenceLine()
GRAPH Tips and Techniques
Display % on the Y-axis but have Y-data label with $
GRAPH FILE CAR
SUM SEATS
ACROSS CAR
ON GRAPH SET LOOKGRAPH BAR
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 GRAPHSTYLE *
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"##'%'");
ENDSTYLE
END
GRAPH Tips and Techniques
Display % on the Y-axis but have Y-data label with $
setTextFormatPreset() - This method assigns a number format to a numeric text object.
setTextFormatPreset(int newValue);
setTextFormatPreset(IdentObj id,int newValue);
id - Is an object ID returned by a getObjectID() method (for example, getY1Label()).
newValue - Is one of the following values:
-1 uses the format defined by setTextFormatPattern().
0...21 selects one of the preset formats.
Value Format Example
0/1= # 123 = 123
2= #% 123 = 12,300%
3= #.#% 123 = 12,300.0%
4= #.##% 123 = 12,300.00%
5= $#.## 123 = $123.00
6= $# 123 = $123
7= #K (show K for values over 999) 1,234 = 1K
8= $#K (show K for values over 999) 1,234 = $1K
9= #M (show M for millions) 1,234,567 = 1M
10= $#M (show M for millions) 1,234,567 = $1M
11= #B (show B for billions) 1,234,567,891 = 1B
12= $#B (show B for billions) 1,234,567,891 = $1B
13= #T (show T for trillions) 1,234,567,891,234 = 1T
14= $#T (show T for trillions) 1,234,567,891,234 = $1T
15= Number with thousands separators, no decimal places. 1,234 = 1K
16= Number with thousands separators, two decimal places. 1,234 = 1.23K
17= General currency format for current locale.
18= Short date format: MM/DD/YY. 10/01/03
19= Medium date format: Mon. DD, YYYY. Oct. 01, 2003
20= Long date format: Month DD, YYYY. October 01, 2003
21= Full date format: Day, Month DD, YYYY. Wednesday, October 01, 2003
GRAPH Tips and Techniques
Display % on the Y-axis but have Y-data label with $
GRAPH FILE CAR
SUM SEATS
ACROSS CAR
ON GRAPH SET LOOKGRAPH BAR
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 GRAPHSTYLE *
setScaleMaxAuto(getY1Axis(), false);
setScaleMax(getY1Axis(),100);
setScaleMinAuto(getY1Axis(), false);
setScaleMin(getY1Axis(),0);
-* Set Percent on Y axis scale
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"##'%'");
-* Set Dollar Sign on Data
setDisplay(getDataText(),true);
setDataTextFormat(-1);
setDataTextFormatPattern(“$##.00");
ENDSTYLE
END
GRAPH Tips and Techniques
Display Bar and Line Graph
GRAPH FILE CAR
SUM RETAIL_COST DEALER_COST
ACROSS CAR
ON GRAPH SET LOOKGRAPH VBAR
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 PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(true);
setConnectScatterMarkers(true);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,1);
setAxisAssignment(1,0);
setSeriesType(1,2);
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 *
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,
BACKCOLOR='NONE',STYLE=NORMAL,$
ENDSTYLE
END
GRAPH Tips and Techniques
Display Bar and Line Graph
GRAPH Tips and Techniques
Display Bar and Line Graph
setSeriesType() - This method sets the series type for a specific object, series number,
or the first item in the selection list.
setSeriesType ( int newValue );
setSeriesType ( IdentObj id, int newValue );
setSeriesType ( int seriesID, int newValue );
id - Is an object ID returned by a getObjectID() method (for example, getSeries()).
seriesID - Is an object number.
newValue - Is a series type. Values can be:
0,
1,
2,
3,
riser
riser
riser
riser
unspecified
bar
marker
area
setAxisAssignment() - In multi-axis graphs, this method can be used to assign individual
series to the Y1, Y2, Y3, Y4, and Y5 axes. If an object id or SeriesID is not specified,
this method sets the axis assignment attribute for the first item in the selection list.
setAxisAssignment (int newValue);
setAxisAssignment (IdentObj id, int newValue);
setAxisAssignment (int seriesID, int newValue);
id - Is an object ID returned by a getObjectID() method (for example, getSeries(1)).
seriesID - Is a series number.
newValue - Can be one of the following values:
0
1
2
3
(Y1
(Y2
(Y3
(Y4
axis)
axis)
axis)
axis)
GRAPH Tips and Techniques
Display Bar and Line Graph
GRAPH FILE CAR
SUM RETAIL_COST DEALER_COST
ACROSS CAR
-*ON GRAPH SET LOOKGRAPH VBAR
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 PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setGraphType(21);
setMarkerDisplay(true);
setConnectLineMarkers(true);
setConnectScatterMarkers(true);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,1);
setAxisAssignment(1,1);
setSeriesType(1,2);
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 *
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,
BACKCOLOR='NONE',STYLE=NORMAL,$
ENDSTYLE
END
GRAPH Tips and Techniques
Display Bar and Line Graph
GRAPH Tips and Techniques
Sort Graph by a Different Value from Display Value
GRAPH FILE CAR
SUM RETAIL_COST
ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH BAR
ON TABLE SET PAGE-NUM ON
ON TABLE NOTOTAL
ON GRAPH PCHOLD FORMAT PNG
END
GRAPH Tips and Techniques
Sort Graph by a Different Value from Display Value
TABLE FILE CAR
SUM RETAIL_COST
BY COUNTRY
ON TABLE HOLD AS C1
END
TABLE FILE C1
PRINT COUNTRY
BY HIGHEST RETAIL_COST
ON TABLE HOLD AS C2
END
-RUN
DEFINE FILE C2
CNTR/I9 WITH COUNTRY=CNTR + 1;
OUTVAL/A25= IF CNTR EQ 1 THEN ' COLUMNS ''' || COUNTRY ||
''''
ELSE ' AND ''' || COUNTRY || '''';
END
TABLE FILE C2
PRINT OUTVAL
ON TABLE SAVE AS ACRLIST
END
-RUN
GRAPH FILE CAR
SUM RETAIL_COST
ACROSS COUNTRY
-INCLUDE ACRLIST
ON GRAPH SET LOOKGRAPH BAR
ON TABLE SET PAGE-NUM ON
ON TABLE NOTOTAL
ON GRAPH PCHOLD FORMAT PNG
END
26
Copyright 2007, Information Builders. Slide 26
Copyright © 2004 Information Builders, Inc.
Download