Defines the attributes of a chart that you can later display using PRINT‑CHART.
DECLARE-CHART chart_name [TYPE=chart_type_lit] [CHART-SIZE=(chart_width_int_lit,chart_depth_int_lit)] [TITLE=title_txt_lit] [SUB-TITLE=subtitle_txt_lit] [FILL=fill_lit] [3D-EFFECTS=3d_effects_lit] [BORDER=border_lit] [COLOR-PALETTE=color_palette_lit] [POINT-MARKERS=point_markers_lit] [ATTRIBUTES={selector_lit| LIST:{selector_list_name_lit|(selector_lit,...)}, {decl_key_lit,{decl_value_lit| LIST:{decl_val_list_name_lit|(decl_val_lit,...)}| PALETTE:{color_palette_lit}}},...}}] [DATA-ARRAY=array_name] [DATA-ARRAY-ROW-COUNT=row_count_num_lit] [DATA-ARRAY-COLUMN-COUNT=column_count_num_lit] [DATA-ARRAY-COLUMN-LABELS={NONE|array_name|(txt_lit,...)}] [DATA-LABELS=data_labels_lit] [FOOTER-TEXT=NONE|text_lit] [SUB-FOOTER-TEXT=NONE|text_lit] [ITEM-COLOR=(item_color_keyword_lit,{color_value_lit|(r,g,b)})] [ITEM-SIZE=(item_size_keyword_lit,item_size_num_lit)] [LEGEND=legend_lit] [LEGEND-TITLE=legend_title_txt_lit] [LEGEND-PLACEMENT=legend_placement_lit] [LEGEND-PRESENTATION=legend_presentation_lit] [PIE-SEGMENT-QUANTITY-DISPLAY=pie_segment_quantity_display_lit] [PIE-SEGMENT-PERCENT-DISPLAY=pie_segment_percent_display_lit] [PIE-SEGMENT-EXPLODE=pie_segment_explode_lit] [X-AXIS-GRID=x_axis_grid_lit] [X-AXIS-LABEL=x_axis_label_txt_lit] [X-AXIS-MIN-VALUE={x_axis_min_value_lit|_num_lit}] [X-AXIS-MAX-VALUE={x_axis_max_value_lit|_num_lit}] [X-AXIS-MAJOR-INCREMENT={x_axis_major_increment_lit|_num_lit}] [X-AXIS-MINOR-INCREMENT=x_axis_minor_increment_num_lit] [X-AXIS-MAJOR-TICK-MARKS=x_axis_major_tick_marks_lit] [X-AXIS-MINOR-TICK-MARKS=x_axis_minor_tick_marks_lit] [X-AXIS-TICK-MARK-PLACEMENT=x_axis_tick_mark_placement_lit] [X-AXIS-ROTATE=x_axis_rotate_num_lit] [X-AXIS-SCALE=x_axis_scale_lit] [Y-AXIS-GRID=y_axis_grid_lit] [Y-AXIS-LABEL=y_axis_label_lit] [Y-AXIS-MASK=mask_txt_lit] [Y-AXIS-MIN-VALUE={y_axis_min_value_lit|_num_lit}] [Y-AXIS-MAX-VALUE={y_axis_max_value_lit|_num_lit}] [Y-AXIS-MAJOR-INCREMENT={y_axis_major_increment_lit|_num_lit}] [Y-AXIS-MINOR-INCREMENT=y_axis_minor_increment_num_lit] [Y-AXIS-MAJOR-TICK-MARKS=y_axis_major_tick_marks_lit] [Y-AXIS-MINOR-TICK-MARKS=y_axis_minor_tick_marks_lit] [Y-AXIS-TICK-MARK-PLACEMENT=y_axis_tick_mark_placement_lit] [Y-AXIS-SCALE=y_axis_scale_lit] [Y2-AXIS-LABEL=y2_axis_label_lit] [Y2-AXIS-MASK=mask_txt_lit] [Y2-AXIS-MIN-VALUE={y2_axis_min_value_lit|_num_lit}] [Y2-AXIS-MAX-VALUE={y2_axis_max_value_lit|_num_lit}] [Y2-AXIS-MAJOR-INCREMENT={y2_axis_major_increment_lit|_num_lit}] [Y2-AXIS-MINOR-INCREMENT=y2_axis_minor_increment_num_lit] [Y2-AXIS-MAJOR-TICK-MARKS=y2_axis_major_tick_marks_lit] [Y2-AXIS-MINOR-TICK-MARKS=y2_axis_minor_tick_marks_lit] [Y2-AXIS-SCALE=y2_axis_scale_lit] [Y2-COLOR-PALETTE=color_palette_lit] [Y2-DATA-ARRAY=array_name] [Y2-DATA-ARRAY-ROW-COUNT=row_count_num_lit] [Y2-DATA-ARRAY-COLUMN-COUNT=column_count_num_lit] [Y2-DATA-ARRAY-COLUMN-LABELS={NONE|array_name|(txt_lit,...)}] [Y2-TYPE=chart_type_lit] END-DECLARE
Table 20 describes the DECLARE-CHART arguments. (These arguments are also valid for PRINT-CHART.) Default values are underlined.
Several of the arguments in Table 20 refer to NewGraphics. To invoke NewGraphics, change the NewGraphics entry in the [Default-Settings] section of SQR.INI to TRUE (NewGraphics=True). (See NewGraphics under [Default-Settings] Section for more information.)
When you use NewGraphics, font values are interpreted as HTML text size values (not point size values). For example, assume you have the following point values:
In this example, if NewGraphics=True, you would convert the points size values to HTML text size values similar to the following:
Table 20. DECLARE-CHART Arguments
YES gives your chart depth. NO displays the chart in a two-dimensional mode. | ||
See Attributes Argument for information on the valid choices. | Defines the appearance of a chart. Production Reporting reads and processes the keywords in the ATTRIBUTES argument left-to-right and first-to-last. As a result, a subsequent value setting overrides a previously-established value. Values assigned with DECLARE‑CHART are overridden by values assigned with PRINT-CHART. Setting the ATTRIBUTES for the ALL selector establishes a default value for all property values within a chart. Any subsequent entry for a specific area, such as Header, overrides the value previously established by the ALL selector. Any invalid combination of selectors, sub-selectors, or declarations produce an error. Note: Some of the keywords in the ATTRIBUTES argument replace the functionality previously provided by the ITEM-COLOR, ITEM-SIZE, LEGEND-PLACEMENT, FILL, and COLOR-PALETTE arguments. Production Reporting processes all old style keyword, value parameters prior to the new ATTRIBUTES argument. This may result in the new ATTRIBUTES argument overriding a value previously established with the old style keyword, value parameter pairs. | |
Size of the chart frame in standard Production Reporting coordinate units. | ||
Defines the color of the individual data points in charts (for example, bar, slice, point). Use CREATE‑COLOR-PALETTE to define a valid Production Reporting color palette to use. Note: The defined color palette is only valid when NewGraphics=TRUE. Note: The FOREGROUND and BACKBROUND declaration keywords in the ATTRIBUTES argument replace the functionality provided by COLOR-PALETTE . As a result, a value set with FOREGROUND or BACKGROUND overrides a value set with COLOR‑PALETTE. | ||
DATA‑ARRAY Y2‑DATA‑ARRAY | Name of the array containing the data to plot. This must be the name of an array defined with CREATE-ARRAY. Use DATA‑ARRAY to define the data array for the Y-Axis. Use Y2‑DATA‑ARRAY to define the data array for the Y2‑Axis. (Y2-Axis values are ignored for pie charts.) Y2‑DATA-ARRAY is only available with NewGraphics. | |
Number of rows or sets of data to use from the DATA‑ARRAY. If DATA‑ARRAY has a greater number of rows, only DATA‑ARRAY‑ROW-COUNT is included in the chart. | ||
(NewGraphics) Number of rows or sets of data to use from Y2‑DATA-ARRAY. If Y2‑DATA-ARRAY has a greater number of rows, only Y2-DATA-ARRAY-ROW-COUNT is included in the chart. | ||
Number of columns to use from DATA‑ARRAY. If the DATA‑ARRAY has a greater number of columns, only DATA-ARRAY-COLUMN-COUNT is included in the chart. | ||
(New Graphics) Number of columns to use from the Y2‑DATA‑ARRAY. If Y2‑DATA-ARRAY has a greater number of columns, only Y2‑DATA-ARRAY-COLUMN-COUNT is included in the chart. | ||
Labels for each Y-Axis value of the data set (fields) in DATA-ARRAY. Labels are displayed in the legend box. Column labels are ignored for pie charts. See Table 65, Chart Array Field Types (fewer than four fields) for applicable fields for each type of chart. | ||
(New Graphics) Labels for each Y2-Axis value of the data set (fields) in Y2‑DATA-ARRAY. Labels are displayed in the legend box. Column labels are ignored for pie charts. SeeTable 65, Chart Array Field Types (fewer than four fields) for applicable fields for each type of chart. | ||
(NewGraphics) If YES, Production Reporting prints the numeric value above the individual data points. If NO, no numeric values are displayed. | ||
Type of filling applied to the shapes (for example, bars, pie-segments) that represent the data loaded in the chart. GRAYSCALE varies the density of black dots. COLOR sends color instructions to the current printer. If the current printer does not support color, then it could appear in GRAYSCALE. CROSSHATCH uses patterns to fill the shapes representing each data set. With NONE all graph shapes are filled with white. Note: The STYLE declaration keyword in the ATTRIBUTES argument replaces the functionality provided by FILL. As a result, a value set with STYLE overrides a value set with FILL. | ||
Footer text for the chart. The text is placed at the bottom of the chart. | ||
ChartBackground—Background color of entire chart area. ChartForeground—Text and Line color of chart area. HeaderBackground—Area within the text box specified for the title and sub-title. HeaderForeground—Text color of the Title and sub-title. LegendBackground—Area within the box defining the legend. LegendForeground—Text and Outline color of the legend. ChartAreaBackground—Area that includes the body of the chart. ChartAreaForeground—Text and Line colors of the chart area. PlotAreaBackground—Area within the X and Y Axis of a chart. Note: For more information see, “Changing Colors with New Graphics” in Volume 1 of the Hyperion SQR Production Reporting Developer's Guide. | (NewGraphics) Color for individual chart items. Specify a chart item and a valid (r,g,b) color to set the color of the chart item. Note: The COLOR declaration keyword in the ATTRIBUTES argument replaces the functionality provided by ITEM-COLOR. As a result, a value set with COLOR overrides a value set with ITEM-COLOR. | |
Title|SubTitle|XAxisLabel| XAxisMarkers|YAxisLabel| YAxisMarkers|Y2AxisLabel| Y2AxisMarkers|LegendText| LegendTitle | (NewGraphics) Size of the following chart objects. The value is based on HTML text sizes.
Note: If you do not define an ITEM-SIZE value, Production Reporting uses the HTML text value of 3 (normal size). Note: The POINT-SIZE declaration keyword in the ATTRIBUTES argument replaces the functionality provided by ITEM-SIZE. As a result, values set with POINT-SIZE override values set with ITEM-SIZE. | |
CENTER-RIGHT | CENTER-LEFT | UPPER-RIGHT | UPPER-LEFT | UPPER-CENTER | LOWER-RIGHT | LOWER-LEFT | LOWER-CENTER | Places the legend in the specified location on the chart. The first portion of the placement parameter (CENTER, UPPER, or LOWER) is the vertical position, and the second portion is the horizontal. Note: The LOCATION declaration keyword in the ATTRIBUTES argument replaces the functionality provided by LEGEND-PLACEMENT. As a result, values set with LOCATION override values set with LEGEND-PLACEMENT. | |
If INSIDE, then the legend is presented inside the area defined by the two axes. If OUTSIDE, then the legend is presented within the chart border, but outside of the region represented by the two axes. | ||
Title for the legend. If NONE, then no title is displayed in the legend box. | ||
Controls what pie segments are exploded (selected) within the pie chart. MAX selects the largest segment. MIN selects the smallest segment. If USE-3RD-DATA-COLUMN, then the third field in the DATA-ARRAY is used to determine which pie segments are exploded. This third field should be a CHAR and values of 'YES' or 'Y' indicate that the segment should be exploded. | ||
If YES, then percent-of-total figures is presented for each pie segment. | ||
If YES, then the quantity is presented for each pie segment. | ||
If YES, then point markers are displayed for line charts. If NO, then point markers are not displayed. | ||
Sub-footer text for the chart. The text is placed below the footer regardless of whether the FOOTER-TEXT is specified. | ||
Subtitle for the chart. Text is placed below the title regardless of whether or not TITLE is specified. | ||
TYPE Y2‑TYPE (no pie charts) | PIE | BAR | AREA | LINE | STACKED‑BAR | OVERLAPPED‑BAR | FLOATING‑BAR | HISTOGRAM | 100%‑BAR | 100%‑AREA | STACKED‑AREA | HIGH‑LOW‑CLOSE | COMBO | XY‑SCATTER‑PLOT | BUBBLE | RADAR | POLAR | CANDLE-STICK | AREA-RADAR | NONE | Chart type. See “Business Charts” in Volume 1 of the Hyperion SQR Production Reporting Developer's Guide |
(NewGraphics) Color palette used to color data points in charts (for example, bar, slice, point). You must define a valid Production Reporting color-palette with CREATE‑COLOR-PALETTE. | ||
X-AXIS-GRID Y-AXIS-GRID Y2-AXIS-GRID | If YES, then a dashed grid line is drawn for each major tick‑mark on the axis. If NO, then no grid line is drawn on this axis. | |
X-AXIS-LABEL Y-AXIS-LABEL Y2-AXIS-LABEL | Line of text to display below (or alongside) the tick-mark labels on the axis. | |
Maximum value on the X axis. Data values greater than X‑AXIS-MAX-VALUE are not displayed. AUTOSCALE calculates an appropriate maximum value. | ||
Maximum value on the Y axis. Data values greater than Y‑AXIS-MAX-VALUE are not displayed. AUTOSCALE calculates an appropriate maximum value. | ||
(NewGraphics) Maximum value on the Y2 axis. Data values greater than Y2-AXIS-MAX-VALUE are not displayed. AUTOSCALE calculates an appropriate maximum value. | ||
Minimum value on the X axis. Data values less than X‑AXIS-MIN-VALUE are not displayed. AUTOSCALE calculates an appropriate minimum value. | ||
Minimum value on the Y axis. Data values less than Y‑AXIS-MIN-VALUE are not displayed. AUTOSCALE calculates an appropriate minimum value. | ||
(NewGraphics) Minimum value on the Y2 axis. Data values less than Y2-AXIS-MIN-VALUE are not displayed. AUTOSCALE calculates an appropriate minimum value. | ||
YES displays tick-marks along the axis between X‑AXIS‑MIN‑VALUE and X‑AXIS‑MAX‑VALUE, according to the X‑AXIS‑SCALE setting spaced by X‑AXIS‑MAJOR‑INCREMENT. | ||
YES displays tick-marks along the axis between Y‑AXIS‑MIN‑VALUE and Y‑AXIS‑MAX‑VALUE, according to the Y‑AXIS‑SCALE setting spaced by Y‑AXIS‑MAJOR‑INCREMENT. | ||
(NewGraphics) YES displays tick-marks along the axis between Y2‑AXIS‑MIN‑VALUE and Y2‑AXIS‑MAX‑VALUE, according to the Y2‑AXIS‑SCALE setting spaced by Y2‑AXIS‑MAJOR‑INCREMENT. | ||
Numeric mask used to format the Y Axis. Follows the edit mask rules defined in Table 56. | ||
(NewGraphics) Numeric mask used to format the Y2 Axis. Follows the edit mask rules defined in Table 56. | ||
YES displays tick‑marks along the axis between X‑AXIS‑MIN‑VALUE and X‑AXIS‑MAX‑VALUE, according to the X‑AXIS‑SCALE setting spaced by X‑AXIS‑MINOR‑INCREMENT. | ||
YES displays tick‑marks along the axis between Y‑AXIS‑MIN‑VALUE and Y‑AXIS‑MAX‑VALUE, according to the Y‑AXIS‑SCALE setting spaced by Y‑AXIS‑MINOR‑INCREMENT. | ||
(NewGraphics) YES displays tick‑marks along the axis between Y2‑AXIS‑MIN‑VALUE and Y2‑AXIS‑MAX‑VALUE, according to the Y2‑AXIS‑SCALE setting spaced by Y2‑AXIS‑MINOR‑INCREMENT. | ||
X‑AXIS‑MAJOR-INCREMENT Y-AXIS-MAJOR-INCREMENT Y2-AXIS-MAJOR‑INCREMENT | Increment used to space major tick‑marks on the axis. AUTOSCALE calculates an appropriate increment. (Y2-AXIS-MAJOR-INCREMENT is only available with NewGraphics) | |
X-AXIS-MINOR‑INCREMENT Y‑AXIS-MINOR-INCREMENT Y2-AXIS‑MINOR-INCREMENT | Increment used to space minor tick‑marks on the axis. This must be set for the X-AXIS-MINOR-TICK-MARKS, the Y-AXIS-MINOR-TICK-MARKS, or the Y2-AXIS-MINOR-TICK-MARKS to display. (Y2-AXIS-MINOR-INCREMENT is only available with NewGraphics) | |
X-Axis-Rotate = 1 Always Rotate X-Axis-Rotate = n Rotate Labels if: Data-Array-Row-Count > n | ||
X-AXIS‑TICK-MARK‑PLACEMENT Y-AXIS‑TICK-MARK-PLACEMENT | INSIDE (or OUTSIDE) directs Production Reporting to place the tick marks on the inside (or outside) of the axis only. BOTH directs Production Reporting to draw the tick-marks such that they appear on both sides of the axis. | |
X‑AXIS-SCALE Y-AXIS-SCALE Y2‑AXIS‑SCALE | LOG specifies a logarithmic scale for the axis. Otherwise, the scale is LINEAR. |
DECLARE-CHART defines the attributes of a chart to print as part of a report. You can use the attributes in any order, with the exception of chart-name, which must follow the DECLARE-CHART keyword. DECLARE‑CHART can only appear in the SETUP section.
A chart defined with DECLARE-CHART prints by referencing its name in PRINT‑CHART. You can override some or all of the chart attributes at run-time with PRINT-CHART. As such, DECLARE-CHART is useful when the basic properties of a chart are common to many PRINT‑CHART commands.
All values declared for a chart in the DECLARE-CHART section of an Production Reporting program become the default values for that chart. To override an assigned value, you must set the value in the PRINT-CHART section of the Production Reporting program. The following example illustrates this functionality.
begin-setup declare-chart default-chart attributes= ('All','Font',31,'Font-Style','Plain','Point-Size',12) attributes= ('Header','Font',31,'Font-Style','Bold','Point-Size',18) attributes= ('chart1','start-angle',0,''threshold-method','percent', 'threshold-value',20) attributes= ('chart1','3d-depth',5,'3d-rotation',65, '3d-elevation',85) attributes= ('chart1','cluster-width',75,'cluster-overlap',65) attributes= ('legend','location','lower-center') attributes= ('chart1.fill','style',LIST:('25per','50per','75per')) attributes= ('chart1.line','style',LIST:'linestyle') attributes= ('all.line','size',2) attributes= ('all.line','color',LIST:(('red'),('green'),('blue'))) attributes= ('chart1','sort-order','Largest') attributes= ('chart1','Background',(230,230,255)) attributes= ('all-axis.marker','foreground',(230,0,100)) end-declare create-array name = emp_sales size = 20 field = col_name:char:1 field = sales:number:3 end-setup
begin-report create-list name='linestyle' list=('longdash','shortdash','dashdot','longshort') put 'Madeline' 10 12 12 into emp_sales(0) col_name(0) sales(0) sales(1) sales (2) put 'Jacob' 25 35 45 into emp_sales(1) col_name(0) sales(0) sales(1) sales (2) put 'Evan' 18 28 38 into emp_sales(2) col_name(0) sales(0) sales(1) sales (2) put 'Claire' 60 70 80 into emp_sales(3) col_name(0) sales(0) sales(1) sales (2) print-chart default-chart (4,1) chart-size = (50,50) title = 'Employee Sales' type = overlapped-bar 3D-effects = yes x-axis-label = 'Employees' y-axis-label = 'Sales (in thousands)' sub-yitle = 'Overlapped-Bar Chart' data-array-row-count = 4 data-array-column-count = 4 data-array-column-labels = ('June', 'July', 'August') data-array = emp_sales footer-text = 'Keep up the good work' sub-footer-text = 'my team' attributes= (LIST:('header','footer'),'Font',32, 'font-style','bold italic','Point-Size',18) end-report
The FILL specification in DECLARE-PRINTER can influence the appearance of the chart. Table 21 lists the final appearance of the chart with a combination of values for PRINTER.COLOR and CHART.FILL options.
This example declares a basic sales chart using DECLARE-CHART. Then, for each region, the SUB-TITLE, DATA-ARRAY, and other elements are overridden to provide the chart with the specific features desired.
begin-setup declare-chart base_sales_chart chart-size = (30, 20 ) title = 'Quarterly Sales' sub-title = none fill = color 3d-effects = yes type = stacked-bar legend-title = 'Product' x-axis-grid = yes end-declare end-setup
begin-program
print-chart base_sales_chart sub-title = 'Region I' data-array = reg1_sales data-array-row-count = #rows_reg1 data-array-column-count = 2 y-axis-max-value = #max_of_all_regions y-axis-min-value = #min_of_all_regions legend = no
print-chart base_sales_chart sub-title = 'Region II' data-array = reg2_sales data-array-row-count = #rows_reg2 data-array-column-count = 2 y-axis-max-value = #max_of_all_regions y-axis-min-value = #min_of_all_regions legend = no
end-program
begin-procedure chart_region_sales ($sub, $ary, #rows, #cols, #max_of_all_regions, #min_of_all_regions)
print-chart base_sales_chart (20, 15 ) sub-title = $sub data-array = all sales data-array-row-count = #rows data-array-column-count = #cols data-array-column-labels = ('Q1', 'Q2', 'Q3', 'Q4' ) y-axis-max-value = #max_of_all_regions y-axis-min-value = #min_of_all_regions chart-size = (50, 30) end-procedure