Topics: |
The matrix chart properties define formats for the matrix labels, headers, and lines and the types of charts in each cell. Matrix charts require the use of WebFOCUS chart attribute syntax, described in WebFOCUS Chart Attribute Syntax.
The following lists the matrix chart properties and their default values:
"matrixProperties": { "chartType": 'bar', "rowLabels": { "labels": undefined, "font": "8pt Sans-Serif", "color": "black", "tooltip": undefined }, "colLabels": { "labels": undefined, "font": "8pt Sans-Serif", "color": "black", "tooltip": undefined }, "rowHeader": { "text": undefined, "font": "10pt Sans-Serif", "color": "black", "tooltip": undefined }, "colHeader": { "text": undefined, "font": "10pt Sans-Serif", "color": "black", "tooltip": undefined }, "cellBorder": { "width": 1, "color": "grey", "dash": "" }, "minCellSize": "auto" }
How to: |
The chartType property controls the type of chart that will be displayed in the matrix cells. You must be sure that you have the correct sort fields and measures, and the corresponding attribute categories for the type of chart you want to display in the matrix cells.
For example, bar, line, and area charts support the same attribute categories, so you can display them interchangeably by changing the chartType property value. You can even use the WebFOCUS Amper Autoprompting feature to present the user with a drop-down list of chart types to choose from.
"matrixProperties": { "chartType": "string"},
where:
Is a supported chart type for the attribute categories in the request. The default value is "bar".
The following request uses a Dialogue Manager amper variable in the definition of the chartType property. The -SET command sets its value to "bar":
-SET &TYPE=bar; GRAPH FILE WF_RETAIL_LITE SUM COGS_US GROSS_PROFIT_US BY TIME_DAYNAME BY BUSINESS_REGION BY PRODUCT_CATEGORY WHERE TIME_DAYNAME EQ 'FRI' OR 'MON' WHERE BUSINESS_REGION NE 'Oceania' 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/ENID_Default.sty,$ TYPE=DATA, COLUMN=TIME_DAYNAME, BUCKET=row, $ TYPE=DATA, COLUMN=BUSINESS_REGION, BUCKET=column, $ TYPE=DATA, COLUMN=COGS_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=GROSS_PROFIT_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=PRODUCT_CATEGORY, BUCKET=x-axis, $ *GRAPH_JS "matrixProperties": {"chartType": "&TYPE"} *END ENDSTYLE END
The output is shown in the following image:
Changing the -SET command to the following, generates an area chart:
-SET &TYPE=area;
The output is shown in the following image:
How to: |
The matrix row labels are the labels displayed at the left of each row.
"matrixProperties": { "rowLabels": { "labels": undefined, "font": "string", "color": "string", "tooltip": "string" }
where:
Is a font string for the row label text. The default value is '8pt Sans-Serif'.
Is a color string for the row labels. The default value is 'black'.
Is a tooltip to display when the mouse hovers over a row label.
The following request formats the row labels in blue, bold, 12pt Sans Serif font, with the tooltip day abbreviation:
GRAPH FILE WF_RETAIL_LITE SUM COGS_US GROSS_PROFIT_US BY TIME_DAYNAME BY BUSINESS_REGION BY PRODUCT_CATEGORY WHERE TIME_DAYNAME EQ 'FRI' OR 'MON' WHERE BUSINESS_REGION NE 'Oceania' ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET LOOKGRAPH BAR ON GRAPH SET STYLE * INCLUDE=ENID_Default.sty,$ TYPE=DATA, COLUMN=TIME_DAYNAME, BUCKET=row, $ TYPE=DATA, COLUMN=BUSINESS_REGION, BUCKET=column, $ TYPE=DATA, COLUMN=COGS_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=GROSS_PROFIT_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=PRODUCT_CATEGORY, BUCKET=x-axis, $ *GRAPH_JS "matrixProperties": {"rowLabels": { "font": "bold 12pt Sans-Serif", "color": "blue", "tooltip": "day abbreviation"}} *END ENDSTYLE END
The output is shown in the following image:
How to: |
The matrix column labels are the labels displayed at the top of each column.
"matrixProperties": { "colLabels": { "labels": undefined, "font": "string", "color": "string", "tooltip": "string" }
where:
Is a font string for the column label text. The default value is "8pt Sans-Serif".
Is a color string for the column labels. The default value is "black".
Is a tooltip to display when the mouse hovers over a column label.
The following request formats the column labels in red, bold, 12pt Sans Serif font, with the tooltip continent:
GRAPH FILE WF_RETAIL_LITE SUM COGS_US GROSS_PROFIT_US BY TIME_DAYNAME BY BUSINESS_REGION BY PRODUCT_CATEGORY WHERE TIME_DAYNAME EQ 'FRI' OR 'MON' WHERE BUSINESS_REGION NE 'Oceania' ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET LOOKGRAPH BAR ON GRAPH SET STYLE * INCLUDE=ENID_Default.sty,$ TYPE=DATA, COLUMN=TIME_DAYNAME, BUCKET=row, $ TYPE=DATA, COLUMN=BUSINESS_REGION, BUCKET=column, $ TYPE=DATA, COLUMN=COGS_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=GROSS_PROFIT_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=PRODUCT_CATEGORY, BUCKET=x-axis, $ *GRAPH_JS "matrixProperties": {"colLabels": { "font": "bold 12pt Sans-Serif", "color": "red", "tooltip": "continent"}} *END ENDSTYLE END
The output is shown in the following image:
How to: |
The matrix row header is the single label drawn at the top of the rows.
"matrixProperties": { "rowHeader": { "text": undefined, "font": "string", "color": "string", "tooltip": "string" }
where:
Is a font string for the row header text. The default value is "10pt Sans-Serif".
Is a color definition string for the row header. The default value is "black".
Is a tooltip to display when the mouse hovers over the row header.
The following request formats the row header in green, bold, 14pt Sans Serif font, with the tooltip row header:
GRAPH FILE WF_RETAIL_LITE SUM COGS_US GROSS_PROFIT_US BY TIME_DAYNAME BY BUSINESS_REGION BY PRODUCT_CATEGORY WHERE TIME_DAYNAME EQ 'FRI' OR 'MON' WHERE BUSINESS_REGION NE 'Oceania' ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET LOOKGRAPH BAR ON GRAPH SET STYLE * INCLUDE=ENID_Default.sty,$ TYPE=DATA, COLUMN=TIME_DAYNAME, BUCKET=row, $ TYPE=DATA, COLUMN=BUSINESS_REGION, BUCKET=column, $ TYPE=DATA, COLUMN=COGS_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=GROSS_PROFIT_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=PRODUCT_CATEGORY, BUCKET=x-axis, $ *GRAPH_JS "matrixProperties": {"rowHeader": { "font": "bold 14pt Sans-Serif", "color": "green", "tooltip": "row header"}} *END ENDSTYLE END
The output is shown in the following image:
How to: |
The matrix column header is the single label drawn at the top of the columns.
"matrixProperties": { "colHeader": { "text": undefined, "font": "string", "color": "string", "tooltip": "string" }
where:
Is a font string for the column header text. The default value is "10pt Sans-Serif".
Is a color definition string for the column header. The default value is "black".
Is a tooltip to display when the mouse hovers over the column header.
The following request formats the column header in brown, bold, 14pt Sans Serif font, with the tooltip column header:
GRAPH FILE WF_RETAIL_LITE SUM COGS_US GROSS_PROFIT_US BY TIME_DAYNAME BY BUSINESS_REGION BY PRODUCT_CATEGORY WHERE TIME_DAYNAME EQ 'FRI' OR 'MON' WHERE BUSINESS_REGION NE 'Oceania' ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET LOOKGRAPH BAR ON GRAPH SET STYLE * INCLUDE=ENID_Default.sty,$ TYPE=DATA, COLUMN=TIME_DAYNAME, BUCKET=row, $ TYPE=DATA, COLUMN=BUSINESS_REGION, BUCKET=column, $ TYPE=DATA, COLUMN=COGS_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=GROSS_PROFIT_US, BUCKET=y-axis, $ TYPE=DATA, COLUMN=PRODUCT_CATEGORY, BUCKET=x-axis, $ *GRAPH_JS "matrixProperties": {"colHeader": { "font": "bold 14pt Sans-Serif", "color": "brown", "tooltip": "column header"}} *END ENDSTYLE END
The output is shown in the following image:
How to: |
The cell borders are the lines drawn between the cells of the matrix.
"matrixProperties": { "cellBorder": { "width": number, "color": "string", "dash": "string" }
where:
Is the width of the cell borders in pixels. The default value is 1.
Is a color definition string for the cell borders. The default value is "grey".
Is the dash style for the cell borders. Specify a dash width in pixels followed by the number of pixels between dashes. The default is no dash (““).
The following request formats the cell borders to be navy with a width of 2 pixels and a dash style in which the length of each dash is 4 pixels and the space between dashes is 2 pixels:
GRAPH FILE WF_RETAIL_LITE
SUM COGS_US GROSS_PROFIT_US
BY TIME_DAYNAME
BY BUSINESS_REGION
BY PRODUCT_CATEGORY
WHERE TIME_DAYNAME EQ 'FRI' OR 'MON'
WHERE BUSINESS_REGION NE 'Oceania'
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET STYLE *
INCLUDE=ENID_Default.sty,$
TYPE=DATA, COLUMN=TIME_DAYNAME, BUCKET=row, $
TYPE=DATA, COLUMN=BUSINESS_REGION, BUCKET=column, $
TYPE=DATA, COLUMN=COGS_US, BUCKET=y-axis, $
TYPE=DATA, COLUMN=GROSS_PROFIT_US, BUCKET=y-axis, $
TYPE=DATA, COLUMN=PRODUCT_CATEGORY, BUCKET=x-axis, $
*GRAPH_JS
"matrixProperties": {"cellBorder": {
"width": 2,
"color": "navy",
"dash": "4 2"}}
*END
ENDSTYLE
END
The output is shown in the following image:
How to: |
You can specify a minimum width and height for the cells in a matrix chart, or use 'auto' to have the chart engine make the cells as small as possible while still being readable.
matrixProperties: { "minCellSize": {"width": number, "height": number}}
where:
Note: Use {"width": 0, "height": 0} to evenly split the available space.
The following request defines the minimum cell size to be {width:300, height:300}, which activates scrolling:
GRAPH FILE WF_RETAIL_LITE
SUM COGS_US GROSS_PROFIT_US
BY TIME_DAYNAME
BY BUSINESS_REGION
BY PRODUCT_CATEGORY
WHERE TIME_DAYNAME EQ 'FRI' OR 'MON'
WHERE BUSINESS_REGION NE 'Oceania'
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET STYLE *
INCLUDE=ENID_default.sty,$
TYPE=DATA, COLUMN=TIME_DAYNAME, BUCKET=row, $
TYPE=DATA, COLUMN=BUSINESS_REGION, BUCKET=column, $
TYPE=DATA, COLUMN=COGS_US, BUCKET=y-axis, $
TYPE=DATA, COLUMN=GROSS_PROFIT_US, BUCKET=y-axis, $
TYPE=DATA, COLUMN=PRODUCT_CATEGORY, BUCKET=x-axis, $
*GRAPH_JS
"matrixProperties": {
"minCellSize": {"width": 300, "height": 300}}
*END
ENDSTYLE
END
The unscrolled output is shown in the following image:
The following image shows the output with the scroll bars dragged to show the complete chart for the cell representing column North America and row MON:
WebFOCUS | |
Feedback |