How to: |
You can create multiple graphs by including secondary sort dimensions (fields).
By default, the number of graphs created depends on the number of values in the fields you designate in the sort (BY, ACROSS) phrases. You can change this default using the GRMERGE parameter:
Multiple graphs can be displayed in either merged format or in columns. For details, see How to Merge Multiple Graphs and How to Display Multiple Graphs in Columns.
SET GRMERGE={ON|OFF|ADVANCED}
where:
Turns on the merge graph option.
Turns off the merge graph option. This is the default.
Turns on the advanced merge option. This option uses three parameters to determine how to merge the graphs:
Note: The sum of the sort fields used by GRMULTIGRAPH, GRLEGEND, and GRXAXIS must equal the number of sort fields in the graph request.
The syntax for the GRMULTIGRAPH, GRLEGEND, and GRXAXIS parameters is:
Specifies how many sort fields (0 through 2) to use to break the output into multiple graphs. The outermost sort fields are used to separate the graphs. When n is greater than zero, this is similar to GRMERGE=OFF, but allows an additional sort field.
Specifies how many of the remaining outermost sort fields (0 through 2), after the ones used for GRMULTIGRAPH, to add to the graph legend. When n is greater than zero, this is similar to GRMERGE=ON, but allows an additional sort field.
Specifies how many of the remaining sort fields (1 through 3) to display on the x-axis. When n is greater than 1, this creates nested x-axes.
The following illustrates a graph with two horizontal, or x-axes, categories (PRODUCT_CATEGORY and BRANDTYPE) that have been merged.
SET GRMERGE=ON GRAPH FILE WF_RETAIL_LITE SUM REVENUE_US MSRP_US DISCOUNT_US ACROSS PRODUCT_CATEGORY BY BRANDTYPE ON GRAPH SET LOOKGRAPH 3D_BAR ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET STYLE * INCLUDE=ENIADefault_combine.sty,$ ENDSTYLE END
The output is:
The following example generates a vertical bar graph that separates the outermost sort field (BRANDTYPE) onto separate graphs, distinguishes the next two sort fields (BRAND and PRODUCT_CATEGORY) by combining them on the graph legend, and places the PRODUCT_SUBCATEG sort field on the x-axis:
GRAPH FILE WF_RETAIL_LITE SUM REVENUE_US BY BRANDTYPE BY BRAND BY PRODUCT_CATEGORY BY PRODUCT_SUBCATEG WHERE BRAND EQ 'Sony' OR 'Samsung' OR 'LG' WHERE PRODUCT_SUBCATEG EQ 'Blu Ray' OR 'Smartphone' OR 'DVD Players' OR 'Headphones' ON GRAPH SET GRMERGE ADVANCED ON GRAPH SET GRMULTIGRAPH 1 ON GRAPH SET GRLEGEND 2 ON GRAPH SET GRXAXIS 1 ON GRAPH SET LOOKGRAPH VBAR ON GRAPH PCHOLD FORMAT JSCHART END
The first chart is for region Major Brand. The legend distinguishes Brand-Category combinations by color, and the Subcategory sort field is repeated on the x-axis for each Brand-Category combination:
SET GRWIDTH=nn
where:
Is the number of columns in which to display multiple graphs. This may be any value from 0-512. The default is 0.
All values from 1-512 will display graphs in an HTML table with the corresponding number of columns. The default value of 0 will display the graphs one under the other in a Java applet.
WebFOCUS |