Topics: |
How to: |
If you want to specify the layout (subtype) for a bar, line, or area chart, include the CHART-SERIES-LAYOUT attribute in the TYPE=REPORT declaration of the WebFOCUS StyleSheet. Layout refers to the positions of the risers in relation to each other.
The default chart layout for bar charts is side-by-side, and the default chart layout for area charts and line charts is absolute.
TYPE=REPORT, CHART-SERIES-LAYOUT=layout,$
where:
Defines the arrangement of risers for bar, line, and area charts. Valid values are:
The following request generates a bar chart whose layout is stacked. The chart type is BAR.
GRAPH FILE WF_RETAIL_LITE
SUM COGS_US
BY BUSINESS_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=REPORT, CHART-SERIES-LAYOUT=stacked,$
TYPE=DATA, COLUMN=COGS_US, BUCKET=y-axis, $
TYPE=DATA, COLUMN=BUSINESS_REGION, BUCKET=color, $
TYPE=DATA, COLUMN=PRODUCT_CATEGORY, BUCKET=x-axis, $
ENDSTYLE
END
The output is shown in the following image:
How to: |
In an absolute bar chart, the bar centers are at the same x-axis point (for a vertical chart) or the same y-axis point (for a horizontal chart). The bar for the first series in the request is placed at the back, with the bars for each subsequent series placed on top of the previous one. The width of each bar added to the chart is scaled so that the bar in back of it remains visible on the sides. Using the absoluteInset property, you can define the width of the smallest bar as a percentage of the width of the largest bar. The other bars will be scaled accordingly
"blaProperties": { "absoluteInset": number }
where:
Is a decimal number between 0 and 1 that represents the width smallest bar as a percentage of the width of the largest bar. The default value is 0.7, which represents 70%.
Note: You can disable the inset effect by setting the absoluteInset value to 1. This makes all of the bars the same width so that they completely overlap each other.
The following request makes the width of the smallest bar 30% the width of the largest bar.
GRAPH FILE WF_RETAIL_LITE
SUM COGS_US
REVENUE_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=report, chart-series-layout=absolute,$
type=data, column=product_category, bucket=x-axis, $
type=data, column=cogs_us, bucket=y-axis, $
type=data, column=revenue_us, bucket=y-axis, $
*GRAPH_JS
"blaProperties": {"absoluteInset": 0.3}
*END
ENDSTYLE
END
The output is shown in the following image.
The following image shows the bar chart without the absoluteInset property.
WebFOCUS | |
Feedback |