Focal Point
[SOLVED] Overlapping charts in HTML forms

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

January 12, 2017, 09:31 AM
zcbillions
[SOLVED] Overlapping charts in HTML forms
Hi all,

I'm new to working in HTML forms. I created a portal once and I was able to overlap 4 charts in the same panel and drill down via the bars in the graph and display a different graph.

My question, in HTML forms am I able to overlap 2 charts and trigger the charts based on passing a parameter using if statements. If the selection is region then display region chart for selected region. if the selection is country the display the chart that displays the country chart.

Thanks for any help in advance!

This message has been edited. Last edited by: Tamra,


WebFOCUS 8
Windows, All Outputs
January 12, 2017, 10:16 AM
Squatch
If I understand you correctly, you may find this thread useful:

[CLOSED]Need Help in JRunning animation and Java script


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
January 12, 2017, 10:25 AM
Squatch
The JavaScript command to trigger your chart would look something like this:

IbComposer_triggerExecution("task2",1);



App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
January 12, 2017, 11:05 AM
zcbillions
of course it needs javascript!

thanks Squatch!


WebFOCUS 8
Windows, All Outputs
January 13, 2017, 11:24 AM
zcbillions
Hey Squatch,

With further researching, I found this:

Create FEX which controls what you execute.

IF radiobutton tells that its "DETAILS" then include detailed fex otherwise summary fex. Also there is SET command to say in which frame to execute the report.


I would like to try and accomplish this through a FEX file instead of javascript, as I'm not too knowledgeable with js. Would I have to create a totally new FEX to manage the switching between to iframes? Or can I accomplish this through one of the graph files?


WebFOCUS 8
Windows, All Outputs
January 13, 2017, 11:42 AM
Squatch
I don't know anything about the FEX control you're referring to...

However, this may be simpler than I thought it was. If you just want to have one display area for multiple reports, you should be able to (in App Studio) create one iframe and target multiple FEXes/Reports to it using the "Tasks" panel.

On the selection of a radio button, you can have the task fire and fill the iframe with the report.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
January 13, 2017, 02:51 PM
zcbillions
there may be a problem? I'm basing this off the selection of a multi-select picklist. Would that be an issue.

For example, if the user makes a selection of a region, then show country chart. If the user doesn't select a region, then show all regions. does that make sense?


WebFOCUS 8
Windows, All Outputs
January 13, 2017, 03:51 PM
Squatch
Okay, so I think what you need to do is have one FEX that is capable of running multiple charts. Now I understand the meaning of your first post better.

Yes, you can use parameters in your FEX combined with IF statements to determine which chart to run.

So "ALL" in WebFOCUS means "_FOC_NULL" gets passed as a parameter to your FEX. You can use that information to determine whether to show REGION or COUNTRY charts.

Here is an example from the CAR file. The CAR field will substitute for your REGION and MODEL will substitute for your COUNTRY. If you choose "No selection" it means the same thing as "ALL". So choosing "No selection" for CAR will result in a CAR (REGION) graph showing, but selecting one or more CARs (REGIONs) will result in selected MODELs (COUNTRYs) showing instead. Don't run this in App Studio, it will probably error out complaining about the CAR amper variable. Drop the code into an App Studio command console instead, then do a "Save As" and it should save as a FEX file. You can then run it from the WebFOCUS portal to see how it works.

ENGINE INT CACHE SET ON

-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';

-DEFAULTH &WF_TITLE='WebFOCUS Report';

-IF &CAR NE '_FOC_NULL' GOTO SKIP_TO_MODEL;

GRAPH FILE ibisamp/car
-* Created by Info Assist for Graph
SUM CAR.BODY.SALES
BY CAR.COMP.CAR
WHERE CAR.COMP.CAR EQ &CAR.(OR(FIND CAR.COMP.CAR IN CAR |FORMAT=A16)).CAR ( = "REGION" ):.;
-*WHERE CAR.CARREC.MODEL EQ '&MODEL.(FIND CAR.CARREC.MODEL IN CAR |FORMAT=A24).MODEL:.';
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET ARGRAPHENGIN JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT

setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
setCurveFitEquationDisplay(false); 
setPlace(true); 

*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);

*END
ENDSTYLE
END

-RUN

-GOTO SKIP_TO_END ;

-SKIP_TO_MODEL

GRAPH FILE ibisamp/car
-* Created by Info Assist for Graph
SUM CAR.BODY.SALES
BY CAR.CARREC.MODEL
WHERE CAR.COMP.CAR EQ &CAR.(OR(FIND CAR.COMP.CAR IN CAR |FORMAT=A16)).CAR:.;
WHERE CAR.CARREC.MODEL EQ &MODEL.(OR(FIND CAR.CARREC.MODEL IN CAR |FORMAT=A24)).MODEL ( = "COUNTRY" ):.;
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET ARGRAPHENGIN JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT

setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
setCurveFitEquationDisplay(false); 
setPlace(true); 

*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);

*END
ENDSTYLE
END

-RUN

-SKIP_TO_END
-EXIT



App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
January 13, 2017, 04:10 PM
zcbillions
Wow, thank you so much Squatch! That's exactly what I was looking for. I need to work on portraying what I want in these posts better. Works perfectly! Cheers!


WebFOCUS 8
Windows, All Outputs