Jump to content

what is the best way to display 2 charts next to each other where comparing the values for different date ranges.


Merin Joseph
Go to solution Solved by David Beagan ,

Recommended Posts

I guess the best way could vary depending on your requirements. Suppose you have a couple of chart fexes each with its own parameters for beginning and ending dates. Then you could use Designer (Assemble Visualizations) to arrange the charts side by side and provide the parameter date entry inputs.

Or you could use App Studio's HTML Canvas to arrange the charts side by side and provide for the date range parameter entry.

Link to comment
Share on other sites

  • Solution

A simpler approach could be accomplished with a single with the code for both charts. There is a basic feature for displaying side by side reports or charts as documented in How to Control Multiple Reports From a Procedure, page 265. With both reports being coded in a single fex, when the fex is run, the two chart outputs will appear side by side. Autoprompt can be used to promopt for all the date parameters. Here's an example after the fex is run, parameters selected and Submit pressed.

image.thumb.png.22a714b77106c9635889bbfa904fc5eb.pngHere is the code for you to try it:

-TYPE WEBFOCUS CGIVAR IBIWF_mreports=FRAME -TYPE WEBFOCUS CGIVAR IBIWF_mrcolumns=2  DEFINE FILE ggsales AMP_YYMD/YYMD = &YYMD; DATE_YYMD/YYMD = AMP_YYMD - SEQ_NO + 1; DATE_YYMt/YYBMt = DATE_YYMD; DATE_D/D = DATE_YYMD; END GRAPH FILE ggsales SUM UNITS AS '' BY DATE_YYMt AS '' BY DATE_D AS '' WHERE DATE_YYMD GE '&STR_DATE1.(|FORMAT=YYMD).' WHERE DATE_YYMD LE '&END_DATE1.(|FORMAT=YYMD).' ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET LOOKGRAPH BAR ON GRAPH SET AUTOFIT ON ON GRAPH SET STYLE *TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $TYPE=DATA, COLUMN=N2, BUCKET=x-axis, $TYPE=DATA, COLUMN=N3, BUCKET=y-axis, $INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$*GRAPH_JS_FINAL"xaxis": { "labels": { "nestingConcatSymbol": undefined } }*ENDENDSTYLEEND  GRAPH FILE ggsales SUM UNITS AS '' BY DATE_YYMt AS '' BY DATE_D AS '' WHERE DATE_YYMD GE '&STR_DATE2.(|FORMAT=YYMD).' WHERE DATE_YYMD LE '&END_DATE2.(|FORMAT=YYMD).' ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET LOOKGRAPH BAR ON GRAPH SET AUTOFIT ON ON GRAPH SET STYLE *TYPE=DATA, COLUMN=N1, BUCKET=x-axis, $TYPE=DATA, COLUMN=N2, BUCKET=x-axis, $TYPE=DATA, COLUMN=N3, BUCKET=y-axis, $INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$*GRAPH_JS_FINAL"xaxis": { "labels": { "nestingConcatSymbol": undefined } }*ENDENDSTYLEEND
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...