Focal Point
graph - more then one trend line?

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

May 13, 2004, 07:33 PM
Leo L
graph - more then one trend line?
Is it possible to have more then one trend line?

I have GTREND ON but when I go to merge 2 graphs because 2 sets of data are the same, not even 1 trend line displays. is it possible to have 2 trendlines for each set of data?

thanks,

Leo
May 14, 2004, 09:06 AM
<Grzegorz>
Leo,

As it is stated in the documentation, the GTREND option is intended to be used to show the linear regression trend on a simple X-Y scatter plot chart, and it really does not perform very well for multi-series charts (see Example 1 below).
There are at least two possibilities to draw trends on any WebFOCUS charts:

It looks like the second method is most flexible and convenient
(especially, if you do not need something like "modified hyperbolic regression" etc.).

Hope this helps
Grzegorz



-* Example 1:
DEFINE FILE CENTORD
BYMONTH/YYM = ORDER_DATE;
END
-*
GRAPH FILE CENTORD
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET HAXIS 1000
ON GRAPH SET VAXIS 630
ON GRAPH SET 3D OFF
ON GRAPH SET GTREND ON
SUM LINEPRICE
LINE_COGS
BY BYMONTH AS 'Month'
ON GRAPH SET GRAPHSTYLE *
setLegendDisplay(true);
setLegendTextAutofit(true);
setO1LabelAutoSkip(1);
setCurveFitEquationDisplay(false);
ENDSTYLE
END

* Example 2:
DEFINE FILE CENTORD
BYMONTH/YYM = ORDER_DATE;
END
-*
GRAPH FILE CENTORD
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET HAXIS 1000
ON GRAPH SET VAXIS 630
ON GRAPH SET 3D OFF
SUM LINEPRICE
LINE_COGS
BY BYMONTH AS 'Month'
ON GRAPH SET GRAPHSTYLE *
setLegendDisplay(true);
setLegendTextAutofit(true);
setO1LabelAutoSkip(1);
setCurveFitEquationDisplay(false);
setCurveFitType(0, 1);
setCurveFitType(1, 1);
ENDSTYLE
END

-* Example 3:
DEFINE FILE CENTORD
BYMONTH/YYM = ORDER_DATE;
END
-*
TABLE FILE CENTORD
SUM LINEPRICE
LINE_COGS
BY BYMONTH
ON BYMONTH RECAP TOTREND/D12.2 = FORECAST(LINEPRICE, 1, 0, 'REGRESS');
ON BYMONTH RECAP COTREND/D12.2 = FORECAST(LINE_COGS, 1, 0, 'REGRESS');
ON TABLE HOLD AS CENTHLD
END
-*
GRAPH FILE CENTHLD
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET HAXIS 1000
ON GRAPH SET VAXIS 630
ON GRAPH SET 3D OFF
SUM LINEPRICE AS 'Line Total'
TOTREND AS 'Trend of Line Total'
LINE_COGS AS 'Line Cost'
COTREND AS 'Trend of Line Cost'
BY BYMONTH AS 'Month'
ON GRAPH SET GRAPHSTYLE *
setLegendDisplay(true);
setLegendTextAutofit(true);
setO1LabelAutoSkip(1);
setSeriesType(0, 1);
setSeriesFillColor(0, new Color(0, 255, 255));
setSeriesType(2, 1);
setSeriesFillColor(2, new Color(255, 255, 0));
setSeriesType(1, 2);
setLineWidth(getSeries(1), 2);
setMarkerSize(getSeries(1), 4);
setSeriesFillColor(1, new Color(0, 255, 0));
setSeriesType(3, 2);
setLineWidth(getSeries(3), 2);
setMarkerSize(getSeries(3), 4);
setSeriesFillColor(3, new Color(255, 0, 0));
ENDSTYLE
END

This message has been edited. Last edited by: <Mabel>,
May 14, 2004, 04:49 PM
Leo L
Wow.. that was exactly what I wanted..
now is it possible to control where to put the elements before hand.. say where to place the equations and legend?

thanks,

Leo
May 17, 2004, 08:18 AM
<Grzegorz>
Perspective for Java (Java GRAPHSTYLE *) API, allows some control over placing and formating various chart elements, but with some limitations as well. There is nothing better, than just to experiment with various properties and methods of the API.
The documentation is available here:
http://documentation.informationbuilders.com/masterinde..._43/javagraphapi.pdf
or
http://www.threedgraphics.com/tdg/products/tools/perspe...va/documentation.asp

Chapter 7. describes various properties to set.
Chapter 8. describes methods to invoke.
Chapter 9. describes the methods returning objects identifiers to pass to the method which require it.
(e.g. getSeries() method returns data series object id, which can be passed to setLineWidth() method).

Hope this helps
Grzegorz