Focal Point
[SOLVED] Variable Number of Graphs to a Single HTML File

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

June 03, 2014, 10:14 AM
J.Hines
[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:


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,



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

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.



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

The life of a designer is a life of fight against the ugliness.