Focal Point
[SOLVED] Stacked Bar Trend Lines

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

March 05, 2009, 05:14 PM
Prarie
[SOLVED] Stacked Bar Trend Lines
First this is a subject that is hard to research...until you know the correct term Curve Line(it just couldn't be what eveyone else calls it!)...and then not any examples - That I've been able to find. Red Face
I did find this topic which was helpful..but leads to my problem.
Is it really not possible to have a Trend Line(CURVE) on a stacked bar graph? I want it for the sum of the stacks - on top. As mentioned in the previous post it does not seem to work. Any way to cheat?
 GRAPH FILE CAR
SUM RETAIL_COST DEALER_COST SALES
ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH VBRSTK1
-*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 PCHOLD FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setX1LabelDisplay(true);
setX1AxisSide(0);
setX1MajorGridDisplay(true);
setX1MajorGridStyle(0);
setX1MinorGridDisplay(false);
setPieDepth(0);
setFontSizeAbsolute(getX1Title(),true);
-*Curve lines
setCurveFitType(0,2);
setCurveFitEquationDisplay(false);

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
END

 

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


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Time to sleep Prarie

tomorrow I will come back on it.




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

Prarie,

as you might have seen is this not so easy.

I answerd also in the other question and found out that you can create trendlines in multigraph graphics.

What you can do, is define the formula for the trendline yourself and use that as the line in the graph

I faked a formula to show this. I'm sure the real formula is a bit more complex and it also depends on what trend line it shout be (polynominal, lineair or whatever)

GRAPH FILE CAR
SUM RETAIL_COST DEALER_COST SALES COMPUTE TOTAMOUNT/D12.2= LAST SALES  + SALES*2 + TOTAMOUNT/1.5;
ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH VBRSTK1
-*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 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);
setAxisAssignment(2,2);
setMarkerDisplay(true);
setConnectLineMarkers(true);
setConnectScatterMarkers(true);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setAxisAssignment(1,1);
setAxisAssignment(2,0);
setSeriesType(2,1);
setAxisAssignment(3,0);
setSeriesType(3,2);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setY2LabelDisplay(true);
setY2AxisSide(0);
setY2MajorGridDisplay(true);
setY2MajorGridStyle(0);
setY2MinorGridDisplay(false);
setTextFormatPreset(getY2Label(),-1);
setTextFormatPattern(getY2Label(),"#.##");
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
ON GRAPH SET STYLE *
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
$
ENDSTYLE
END


This is the example with the multigraph settings
I added here the 4the BAR with the computed trendline. this is in fact what you need.

GRAPH FILE CAR
SUM RETAIL_COST DEALER_COST SALES COMPUTE TOTAMOUNT/D12.2=RETAIL_COST + DEALER_COST + SALES ;
ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH MULTI4Y
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID OFF
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(true);
setCurveFitType(3,5);
setCurveFitPolynomialOrder(3,3);
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(false);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setAxisAssignment(1,1);
setAxisAssignment(2,2);
setAxisAssignment(3,3);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(false);
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
ON GRAPH SET STYLE *
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
$
ENDSTYLE
END



I'll take a second look at the documentation to find out if there is an other way.




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

Bless You Frank...I believe your first example is what I need! Thanks so much. Smiler