Topics: |
How to: |
Each field in the chart request is either a measure (value that can be aggregated) or a dimension (field that categorizes measures, used typically as sort fields in a chart request).
Some attribute categories can only be assigned to sort fields, some can only be assigned to measures, and some can be assigned to either.
The order of sort fields in the request and the type of chart being generated determine the category to which each field can be assigned.
The assignment of fields to attribute categories replaces the GRMERGE, GRMULTIGRAPH, GRLEGEND, and GRXAXIS parameters for merging charts. For information about converting requests with merge parameters to chart attribute syntax, see Converting Requests to Chart Attribute Syntax.
TYPE=DATA, COLUMN=colspec, bucket=category,$
where:
Is any valid column reference in a WebFOCUS StyleSheet.
For example, COLUMN=N1 represents the first column of output. This is usually the high-order BY field, as described in Understanding Column Sequence Numbers. Alternatively, you can specify the field name, for example, COLUMN=PRODUCT_CATEGORY. For information about WebFOCUS StyleSheet syntax, see the Creating Reports With WebFOCUS Language manual.
Describes the role this field is assigned in the chart.
Valid attribute category values vary by chart type. The list of all categories follows:
Some attribute categories can be omitted, if you do not want them on the chart output or if they do not apply to the type of chart being created. Some attribute categories can be assigned to multiple fields in the request (for example, multiple fields assigned to the y-axis in bar or line charts).
The following request generates a separate bar chart for each business region. The BUSINESS_REGION field is added as the first sort field and is assigned to the page category. The business region value is also added to the heading, which is embedded in the chart:
GRAPH FILE WF_RETAIL_LITE HEADING "Business Region: <BUSINESS_REGION " SUM COGS_US BY BUSINESS_REGION BY BUSINESS_SUB_REGION BY PRODUCT_CATEGORY ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET EMBEDHEADING ON ON GRAPH SET LOOKGRAPH BAR ON GRAPH SET STYLE * INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENWarm.sty,$ TYPE=DATA, COLUMN=COGS_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=PRODUCT_CATEGORY, BUCKET=X-AXIS, $ TYPE=DATA, COLUMN=BUSINESS_REGION, BUCKET=page,$ TYPE=DATA, COLUMN = BUSINESS_SUB_REGION, BUCKET=color,$ ENDSTYLE END
The output is shown in the following image. A separate chart is generated for each business region:
Instead of adding a heading to indicate the business region, you can add the field to the tooltip category as well as the page category. For information and an example, see Assigning a Field to Mulitple Attribute Categories.
Some categories can have multiple fields assigned to them. By default, the fields are assigned to a category in the order in which the assignments appear in the StyleSheet. For example, the first y-axis field assigned becomes the leftmost measure in a vertical bar chart. If you want to specify the order in which the fields should be assigned to the category, use an index number suffix. For example, using the following declarations, UNITS will come first regardless of its order in the request, since its suffix (.1) is explicitly set to be lower than that of BUDUNITS (.2):
type=data, column=budunits, bucket=y-axis.2, $ type=data, column=units, bucket=y-axis.1, $
The following request generates a bar chart. the bars represent the GROSS_PROFIT_US and REVENUE_US measures. The bar representing GROSS_PROFIT_US is first because the StyleSheet declarations specify GROSS_PROFIT_US before REVENUE_US:
GRAPH FILE WF_RETAIL_LITE SUM GROSS_PROFIT_US REVENUE_US BY PRODUCT_CATEGORY ON GRAPH SET LOOKGRAPH BAR ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET STYLE * INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENWarm.sty,$ type=data, column=product_category, bucket=x-axis, $ type=data, column=gross_profit_us, bucket=y-axis, $ type=data, column=revenue_us, bucket=y-axis, $ ENDSTYLE END
The output is shown in the following image:
The following version of the request displays the bars for REVENUE_US first by adding a .1 suffix to the attribute category for the REVENUE_US field:
GRAPH FILE WF_RETAIL_LITE
SUM
GROSS_PROFIT_US
REVENUE_US
BY PRODUCT_CATEGORY
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENWarm.sty,$
type=data, column=product_category, bucket=x-axis, $
type=data, column=gross_profit_us, bucket=y-axis, $
type=data, column=revenue_us, bucket=y-axis.1, $
ENDSTYLE
END
The output is shown in the following image:
An attribute category can have a subscript, enclosed in parentheses, if there is more than one version of it. For example, to indicate the y2-axis, use the following:
y-axis(2)
Any number of y-axes can be specified using subscripts.
A category can have both a subscript and a suffix. For example, to indicate the first field in the y2-axis category, use the following:
y-axis(2).1
The following request assigns the measure DISCOUNT_US to the y-axis, the measures GROSS_PROFIT_US and MSRP_US to the y2-axis, and the measure REVENUE_US to the y3-axis. The axes are drawn as split y-axes (stacked on top of each other) because the blaProperties:splitY property is set to true:
GRAPH FILE WF_RETAIL_LITE SUM DISCOUNT_US GROSS_PROFIT_US REVENUE_US MSRP_US BY PRODUCT_CATEGORY ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET LOOKGRAPH BAR ON GRAPH SET STYLE * INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENWarm.sty,$ type=data, column=product_category, bucket=x-axis,$ type=data, column=discount_us, bucket=y-axis,$ type=data, column=GROSS_PROFIT_US, bucket=y-axis(2),$ type=data, column=MSRP_US, bucket=y-axis(3),$ type=data, column=REVENUE_US, bucket=y-axis(2),$ *GRAPH_JS "blaProperties": {"splitY": true}, "legend": {"visible": false} *END ENDSTYLE END
The output is shown in the following image:
To assign a field to multiple attribute categories, enclose the list of categories in parentheses and separate them with a blank space:
TYPE=DATA, COLUMN=colspec, bucket=(category1 category2 ...),$
For example, the following declaration adds a field to both the page and tooltip categories:
TYPE=DATA, COLUMN=N1, BUCKET=(page tooltip),$
The following request generates a separate bar chart for each business region. The BUSINESS_REGION field is added as the first sort field and is assigned to the page and tooltip categories:
GRAPH FILE WF_RETAIL_LITE
SUM COGS_US
BY BUSINESS_REGION
BY BUSINESS_SUB_REGION
BY PRODUCT_CATEGORY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENWarm.sty,$
TYPE=DATA, COLUMN=COGS_US, BUCKET=y-axis, $
TYPE=DATA, COLUMN=BUSINESS_SUB_REGION, BUCKET=color, $
TYPE=DATA, COLUMN=PRODUCT_CATEGORY, BUCKET=x-axis, $
TYPE=DATA, COLUMN=BUSINESS_REGION, BUCKET=(page tooltip),$
ENDSTYLE
END
The following image shows that the business region generates a new page and has been added to the tooltip:
WebFOCUS | |
Feedback |