[SOLVED] Variable Number of Graphs to a Single HTML File
I wanted to try to do this with CAR and provide some code, but as I'm still very much learning FOCUS, I was afraid any code I posted would muddy the waters.
So here's what I'm trying to do:
User picks a country, which has certain CARs. Those cars get saved to a hold file (I think). For example, the user picks ITALY, which has 2 cars: ALFA ROMEO and MASERATI.
The held list of cars is read, and for each car create a bar graph (GIF format is fine) of Dealer Cost by Model. In this example, that would be two bar graphs. The first would show all the Alfa models (one bar for each) with the value of the bar being the model's price, and the second graph would be the single Maserati model and it's price.
The final result should be an HTML file (or Excel) of all the graphs that were generated.
I assume I'll need a REPEAT loop, I'm just not sure how to keep an HTML file open to write any number of graphs to it. As per the CAR data, each CAR has a different number of models, and so a different set of graphs would be created depending on what's selected.
Any help would be appreciated. Like I said, I'm still learning, so thorough explanations are very helpful so that I know the WHY, not just the code to use.
Thanks!This message has been edited. Last edited by: J.Hines,
The life of a designer is a life of fight against the ugliness.
June 03, 2014, 11:47 AM
Wep5622
You can do that with a single advanced graph using a suitable combination of these settings:
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 1
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
Here, the first BY field is used to split the data among graphs and the second by (or across) is used for the ordinal axis.
You can set that from the advanced graph editor, that is somewhere in there (just a tad hard to find).
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
June 03, 2014, 02:20 PM
J.Hines
Got it I think, thanks Wep! I was thinking I would need Hold files, Repeat loops, and everything, what a relief for this to be easier than expected for once!
For anyone else who wonders, this was the setup to create multiple graphs: Filter: COUNTRY Equal to Dynamic Parameter Measure (Sum): DEALER_COST X Axis: MODEL Multi-graph: CAR
Then I just created an HTML file, threw the graph procedure in there, and let it create the drop-down list for the Country parameter.