Focal Point
Trend Lines

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

August 19, 2004, 09:46 AM
<Thariq>
Trend Lines
HI,
PLease provide me a solution ??I am able to create linear trend line calculated by Ordinary Least Squares (OLS) regression analysis by setting the gtrend to ON status.Could anyone tell me how to go ahead and create powerseries trend lines? ie,not a linear trend line, but should be curve type best fitted to the data on to a Scattered Graph.

Thanks!!

Thariq
August 19, 2004, 02:54 PM
Larry Eiss
Tariq,

Curve fitting in WebFOCUS Graphs is very flexible. Below is a FEX you can run against the CAR file to see an example. After the FEX I have more comments, so be sure to scroll down.

-------- BEGIN FEX --------
-* File CurveFit.FEX
GRAPH FILE CAR
SUM SALES
ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setX1LabelDisplay(true);
setX1AxisSide(0);
setX1MajorGridDisplay(true);
setX1MajorGridStyle(0);
setX1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieDepth(0);
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setLegendDisplay(true);
setLegendTextAutofit(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getX1Title(),true);
setO1LabelAutofit(true);
setCurveFitType(0,2);
setCurveFitEquationDisplay(false);
ENDSTYLE
END
----------- END FEX ----------

Notice the last two lines above the ENDSTYLE statement. This is the code that creates the trend line.

Below is some information on the various curve fitting options available to you. To use these you would replace the digit "2" in the setCurveFitType() call above with one of the values below.

CurveFitType
Value Description
0 None
1 Linear regression curve fit line
2 Quadratic curve fit line
3 Polynomial fit line
4 Hyperbolic curve fit line
5 Logarithmic curve fit line
6 Modified hyperbolic
7 Rational curve fit line
8 Exponential curve fit line
9 Modified exponential
10 Logarithmic/Quadratic curve fit line
11 Geometric curve fit line

I hope this proves helpful,
--WebFOCUS Product Management
August 20, 2004, 10:42 AM
<Thariq>
Thanks a lot Larry!! It really works.But I do have more questions on the topic.

I plotted diffrent points with respect to X and Y axis and created a Geometric curve fit
trend line.My question is How will we plot the points in the scatter graph with different legends(colors) based on a third field other than the x and y axis ie I want to segregate the points with respect to the third field.For e.g.: The table has three fields- Customer, Volume and Price. We have price and volume in the x and y axis respectively. Based on customer the color of the points should vary in the scatter graph.

My real question comes.As per your suggestion I was able to generate trend line (Geometric curve fit line)with respect to X any Y (ie price and volume),what should be done to get the same earlier trend line that we generated as it is even after if I segregate the points with respect to the third field(customer).My doubt is will the trend lines be generated as per the segregation for each customer??

Thanks

Thariq


quote:
Originally posted by Larry Eiss:
[qb] Tariq,

Curve fitting in WebFOCUS Graphs is very flexible. Below is a FEX you can run against the CAR file to see an example. After the FEX I have more comments, so be sure to scroll down.

-------- BEGIN FEX --------
-* File CurveFit.FEX
GRAPH FILE CAR
SUM SALES
ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setX1LabelDisplay(true);
setX1AxisSide(0);
setX1MajorGridDisplay(true);
setX1MajorGridStyle(0);
setX1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieDepth(0);
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setLegendDisplay(true);
setLegendTextAutofit(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getX1Title(),true);
setO1LabelAutofit(true);
setCurveFitType(0,2);
setCurveFitEquationDisplay(false);
ENDSTYLE
END
----------- END FEX ----------

Notice the last two lines above the ENDSTYLE statement. This is the code that creates the trend line.

Below is some information on the various curve fitting options available to you. To use these you would replace the digit "2" in the setCurveFitType() call above with one of the values below.

CurveFitType
Value Description
0 None
1 Linear regression curve fit line
2 Quadratic curve fit line
3 Polynomial fit line
4 Hyperbolic curve fit line
5 Logarithmic curve fit line
6 Modified hyperbolic
7 Rational curve fit line
8 Exponential curve fit line
9 Modified exponential
10 Logarithmic/Quadratic curve fit line
11 Geometric curve fit line

I hope this proves helpful,
--WebFOCUS Product Management [/qb]

August 06, 2007, 02:11 PM
ypatel
Does anyone know how to draw trend lines on stark bar graph ?? I can put trendline on simple bar graph but the same commands don't put trendlines on stack bar graph.

Here is an example of my graph..
-*
GRAPH FILE CAR
SUM RETAIL_COST DEALER_COST SALES
ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH VBRSTK1
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setX1LabelDisplay(true);
setX1AxisSide(0);
setX1MajorGridDisplay(true);
setX1MajorGridStyle(0);
setX1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieDepth(0);
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setLegendDisplay(true);
setLegendTextAutofit(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getX1Title(),true);
setO1LabelAutofit(true);
setCurveFitType(0,2);
setCurveFitEquationDisplay(false);
ENDSTYLE
END


-Yogesh Patel
------------------------------------------------------------------------
PROD: WF 764 on Linux Apache tomcat v5.5
DEV: WF 768 on Linux
August 06, 2007, 02:42 PM
FrankDutch
What should be the basic value for the trend analyzes? The sum of the stacked value, or the individual values (that would give several trends)

What you can do, is calculate the wanted trend in the fex that collects the data and ad that line as an extra field in the graph. (not stacked)




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

August 09, 2007, 09:26 AM
ypatel
We want to show three trend lines for three summed values that we see stack'd on graph. Basically a trend line for each field, we don't want to show a line that touches high point of a field for each conuntry etc. We want a true tren line for each of the three fields we summ.


quote:
Originally posted by FrankDutch:
What should be the basic value for the trend analyzes? The sum of the stacked value, or the individual values (that would give several trends)

What you can do, is calculate the wanted trend in the fex that collects the data and ad that line as an extra field in the graph. (not stacked)



-Yogesh Patel
------------------------------------------------------------------------
PROD: WF 764 on Linux Apache tomcat v5.5
DEV: WF 768 on Linux
August 09, 2007, 10:32 AM
FrankDutch
How about this ?

GRAPH FILE CAR
SUM RETAIL_COST DEALER_COST SALES
ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH MULTI3Y
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 *
setX1LabelDisplay(true);
setX1AxisSide(0);
setX1MajorGridDisplay(true);
setX1MajorGridStyle(0);
setX1MinorGridDisplay(false);
setPieDepth(0);
setFontSizeAbsolute(getX1Title(),true);
setCurveFitEquationDisplay(false);
setCurveFitType(0,5);
setCurveFitPolynomialOrder(0,3);
setCurveFitType(1,5);
setCurveFitPolynomialOrder(1,3);
setCurveFitType(2,5);
setCurveFitPolynomialOrder(2,3);
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setAxisAssignment(1,1);
setAxisAssignment(2,2);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
ENDSTYLE





Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

August 09, 2007, 11:02 AM
ypatel
It's a possible option. As soon as I change graph type to 'ON GRAPH SET LOOKGRAPH VBRSTK1'
trend lines disappear, so it seems like trend lines don't appear with stack'd bar graph.

Thanks for your time !!


-Yogesh Patel
------------------------------------------------------------------------
PROD: WF 764 on Linux Apache tomcat v5.5
DEV: WF 768 on Linux