Focal Point
Graphing

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

November 28, 2007, 04:39 PM
Tom Wikle
Graphing
Is there a way to add a trendline to a graph? In Excel you can add a trendline to show a what a trend will look like over a period of time (ex. 6 months into the future). Can WebFOCUS do something similar?
November 28, 2007, 05:10 PM
GinnyJakes
Yes, Tom, you can do that. You can use the FORECAST function to calculate the values for the trendline and graph it as another column. If your chart type is a bar, you can change the bar to a line for your trend column.

Depending on your release (please update your signature with your environment specs), you will either have to edit the graph API or you can set it in the GUI.

Please let us know what else you need.


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
November 29, 2007, 09:18 AM
PBrightwell
This example is using historic data instead of forecast data, but I think it is what you are looking for. AVG is my trend for the 4 regions.
[code]
GRAPH FILE THOLD1
PRINT
APR_CNT AS 'APR'
EAR_CNT AS 'EAR'
LAR_CNT AS 'LAR'
MER_CNT AS 'MER'
AVG
ACROSS T_DATE AS ''


ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET 3D OFF
ON GRAPH SET BARNUMB OFF
ON GRAPH SET GRID ON
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET GRMERGE ON
ON GRAPH SET VZERO ON
ON GRAPH SET VAXIS 560
ON GRAPH SET HAXIS 1100
ON GRAPH SET GRAPHSTYLE *
setSeriesType(0,1);
setLegendDisplay(true);
setLegendMarkerPosition(0);
setMarkerDisplay(true);
setUseSeriesShapes(false);
setConnectLineMarkers(true);
setConnectScatterMarkers(true);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(4);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,1);
setAxisAssignment(1,0);
setSeriesType(1,1);
setAxisAssignment(4,1);
setSeriesType(4,2);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),1);
-* setTextFormatPattern(getY1Label(),"#.##");
-* setY2LabelDisplay(true);
-* setY2AxisSide(1);
-*setY2MajorGridDisplay(false);
-* setY2MinorGridDisplay(false);
-* setTextFormatPreset(getY2Label(),2);
setDataTextDisplay(true);
setCustomDataText(getSeries(0), true);
setCustomDataText(getSeries(1), true);
setCustomDataText(getSeries(2), true);
setCustomDataText(getSeries(3), true);
setCustomDataText(getSeries(4), true);
setCustomDataText(getSeries(5), true);
setDisplay(getDataText(0), false);
setDisplay(getDataText(1), false);
setDisplay(getDataText(2), false);
setDisplay(getDataText(3), false);
setDisplay(getDataText(4), false);
setDisplay(getDataText(5), true);
setTextFormatPreset(getDataText(2),2);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setTextJustHoriz(getO1Label(),2);
setFontSizeAbsolute(getO1Label(),true);
setFontSize(getO1Label(),12);
setTextRotation(getO1Label(),3);
setTextWrap(getO1Label(),false);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
ENDSTYLE
ON GRAPH SET STYLE *

TYPE=DATA,
FIELD=APR_CNT,
COLOR=RED,
$
TYPE=DATA,
FIELD=EAR_CNT,
COLOR=PURPLE,
$
TYPE=DATA,
FIELD=LAR_CNT,
COLOR=RGB(255 215 0),
$
TYPE=DATA,
FIELD=MER_CNT,
COLOR=GREEN,
$
TYPE=DATA,
FIELD=AVG,
COLOR=NAVY,
$
ENDSTYLE
ON GRAPH PCHOLD FORMAT HTML
END
[\code]


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes