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:
Using setCurveFitType(...) method from the "Java GRAPHSTYLE" API (Example 2)
Calculating the Trend value in FOCUS, HOLDing the results, and then displaying it just like normal data series. (Example 3).
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 ENDThis 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?
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).