So here is what I did:
1.) Create a HOLD-File H_DATES with the last 365 dates as
CALDAY_NAME
2.) Create a HOLD-File H_LINES with the values for the line series with
MISSING ON
and
BY NAME
3.) Create a Hold-File H_BARS with the values for the bar series with
MISSING ON
and
BY NAME
4.) Match the files from Step 2 and 3. The Option
OLD-OR-NEW
ensures that I get all the data from both files, even with I do not have a corresponding date in on of them.
MATCH FILE H_LINES
PRINT LINEPRICE
BY CALDAY_NAME
RUN
FILE H_BARS
PRINT BARPRICE
CALDAY_NAME
AFTER MATCH HOLD AS H_GRAPH OLD-OR-NEW
END
-RUN
5.)Join the files from Step 1 and Step 4 to build my X-axis:
JOIN
LEFT_OUTER H_DATES.CALDAY_NAME IN DATES TO MULTIPLE
H_GRAPH.CALDAY_NAME IN H_GRAPH TAG J4 AS J4
END
6.)Build a last HOLD-File to prepare the data for my graph:
TABLE FILE H_DATES
PRINT
J4.H_GRAPH.LINEPRICE
J4.H_GRAPH.BARPRICE
BY H_DATES.CALDAY_NAME
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS H_GRAPH_2 FORMAT FOCUS
END
7.) Give a Define on Step 6, as I want to show Month and Year on the y-axis
DEFINE FILE H_GRAPH_2
YEAR/A4 = EDIT (CALDAY_NAME, '9999$$$$');
MONTH/A2 = EDIT (CALDAY_NAME, '$$$$99$$');
END
8.) Create Graph
GRAPH FILE H_GRAPH_2
-* Created by Advanced Graph Assistant
SUM
LINEPRICE
BARPRICE
BY YEAR
BY MONTH
BY CALDAY_NAME NOPRINT
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
...
I figured out that ON GRAPH SETSTYLE, following options had to be set:
ON GRAPH SET GRAPHSTYLE *
...
setFillMissingData(2);
setNumMissingDataSegments(25);
setScaleFromZero(false);
setRiserWidth(50);
...
I'm still working on one thing: I want to display the labels for BARPRICE. Unfortunately - I think due to the interpolation with setFillMissingData(2) - the labels for BARPRICE are even shown for the interpolated values. Maybe I can figure this out too.
Thanks all for your help.
WF 7.6.9
PMF 5.1.3
BID 7.6.9
Win XP
HTML, PDF, Excel, PowerPoint