DECLARE-CHART

Syntax

DECLARE-CHART chart_name [DATA-LABELS=data_labels_lit] [COLOR-PALETTE=color_palette_lit] [ITEM-COLOR=(chart_item_keyword_lit, color_value_lit |(r,g,b)] [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] [POINT-MARKERS=point_markers_lit] [TYPE=chart_type_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_segement_quantity_display_lit] [PIE-SEGMENT-PERCENT-DISPLAY= pie_segement_percent_display_lit] [PIE-SEGMENT-EXPLODE=pie_segement_explode_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-SCALE=x_axis_scale_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-MAJOR-INCREMENT= {x_axis_major_increment_lit|_num_lit}] [X-AXIS-MINOR-INCREMENT= x_axis_minor_increment_num_lit] [X-AXIS-TICK-MARK-PLACEMENT= x_axis_tick_mark_placement_lit] [X-AXIS-GRID=x_axis_grid_lit] [Y-AXIS-LABEL=y_axis_label_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-SCALE=y_axis_scale_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-MAJOR-INCREMENT= {y_axis_major_increment_lit|_num_lit}] [Y-AXIS-MINOR-INCREMENT= y_axis_minor_increment_num_lit] [Y-AXIS-TICK-MARK-PLACEMENT= y_axis_tick_mark_placement_lit] [Y-AXIS-GRID=y_axis_grid_lit] END-DECLARE

Note:

If CHART-SIZE is not defined, it must be defined in PRINT-CHART.

Description

Defines the attributes of a chart that can later be displayed using PRINT-CHART.

The DECLARE-CHART command can define the attributes of a chart to be printed as part of a report.

This command can appear only in the SETUP section.

A chart defined with DECLARE-CHART is printed by referencing its name in the PRINT-CHART command. Some or all of the chart attributes can be overridden at runtime with the PRINT-CHART command. As such, DECLARE-CHART is useful when the basic properties of a chart are common to many PRINT-CHART commands.

Note:

All DECLARE-CHART attributes can be overridden as part of the PRINT-CHART command. Columns are not supported within the DECLARE-CHART command or the PRINT-CHART command. Attributes that are specified more than once produce a warning, and the first instance is regarded as the actual value. Attributes can be used in any order, with the exception of chart-name, which must follow the DECLARE-CHART keyword.

Also, the FILL specification in the DECLARE-PRINTER command can influence the appearance of the chart. The following table lists the final appearance of the chart with a combination of values for PRINTER.COLOR and CHART.FILL options.

CHART.FILL= PRINTER.COLOR=Y PRINTER.COLOR=N

GRAYSCALE

GRAYSCALE

GRAYSCALE

COLOR

COLOR

GRAYSCALE

CROSS­HATCH

COLOR-CROSS­HATCH

CROSSHATCH

NONE

NONE

NONE

Parameters

Parameter Description

chart_name

A unique name to be used for referencing a chart.

CHART-SIZE

The size of the chart frame in standard SQR coordinate units.

The following DECLARE-CHART Command Arguments table describes other arguments for the DECLARE-CHART command.

Note:

Oracle does not currently support setting NewGraphics to Yes. You should not use the DATA-LABELS, COLOR-PALETTE, and ITEM-COLOR attributes listed in the following table because they are valid only when NewGraphics=Yes.

Argument Values Description

DATA-LABELS

Yes|No

If NewGraphics is set to Yes, use this argument to specify whether SQR prints the numeric value above the individual data points. Set to NO to suppress the numeric values.

COLOR-PALETTE

palette_name

If NewGraphics is set to Yes, use this argument to specify the name of the color palette to be used to color the individual data points in each chart (for example, bar, slice, point). A valid SQR color-palette must be defined to use COLOR-PALETTE.

ITEM-COLOR

ChartBackground|ChartForeground

HeaderBackground|HeaderForeground

FooterBackground|FooterForeground

LegendBackground|LegendForeground

ChartAreaBackground|ChartAreaForeground

PlotAreaBackground

If NewGraphics is set to Yes, use this argument to specify the color of an individual item in a chart. Specify a chart item and a valid (r,g,b) color to set the color of the chart item.

TITLE

NONE | text

Specifies a title for the chart. That text is placed at the top of the chart.

SUB-TITLE

NONE | text

Specifies a subtitle for the chart. That text is placed below the title regardless of whether TITLE is specified.

FILL

GRAYSCALE | COLOR | CROSS­HATCH | NONE

Specifies the type of filling that is applied to the shapes (bars, pie segments, and so on) 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 color can appear in a GRAYSCALE fashion. CROSSHATCH uses patterns to fill the shapes representing each data set. With NONE, all graph shapes are filled with white.

3D-EFFECTS

YES | NO

Specifies whether the chart depth appears with 3-D effects. If this argument is set to NO, the chart is displayed in the default 2D mode.

BORDER

YES | NO

If this argument is set to YES, a border is drawn around the chart. If it is set to NO, no border is displayed around the chart.

POINT-MARKERS

YES | NO

Specifies whether point markers appear on line charts. If this argument is set to YES, point markers appear on line charts. If it is set to NO, point markers do not appear.

TYPE

LINE | PIE | BAR, STACKED-BAR | 100%-BAR | OVERLAPPED-BAR | FLOATING-BAR | HISTOGRAM | AREA | STACKED-AREA | 100%-AREA | XY-SCATTER-PLOT | HIGH-LOW-CLOSE

Specifies the type of chart.

See SQR for PeopleSoft Developers: Understanding Business Charts.

LEGEND

YES | NO

Specifies whether to display a legend.

LEGEND-TITLE

NONE | text

Specifies the title for the legend. If this argument is set to NONE, no title is displayed in the legend box.

LEGEND-PLACEMENT

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 (RIGHT, LEFT, or CENTER) is the horizontal.

LEGEND-PRESENTATION

INSIDE | OUTSIDE

Specifies where the legend appears on the chart. If this argument is set to INSIDE, the legend is presented inside the area defined by the two axes. If it is set to OUTSIDE, the legend is presented within the chart border, but outside of the region represented by the two axes.

PIE-SEGMENT-QUANTITY- DISPLAY

YES | NO

Specifies whether quantity is presented for each pie segment. If this argument is set to YES, the quantity is presented.

PIE-SEGMENT-PERCENT-DISPLAY

YES | NO

Specifies whether the percent-of-total number is presented for each pie segment. If this argument is set to YES, the percent-of-total figures is presented.

PIE-SEGMENT-EXPLODE

NONE | MAX |MIN | USE-3RD-DATA-COLUMN

Controls which pie segments are exploded (selected) within the pie chart. MAX selects the largest segment. MIN selects the smallest segment. USE-3RD-DATA-COLUMN uses the third field in the DATA-ARRAY 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.

X-AXIS-LABEL or Y-AXIS-LABEL

NONE | text

Specifies a line of text to be displayed below (or alongside) the tick-mark labels on the axis.

X-AXIS-MIN-VALUE

AUTOSCALE | number

Specifies the minimum value on the axis. If data values exist that are less than X-AXIS- MIN-VALUE, they are not displayed. AUTOSCALE directs SQR to calculate an appropriate minimum value.

Y-AXIS-MIN-VALUE

AUTOSCALE | number

Specifies the minimum value on the axis. If data values exist that are less than Y-AXIS- MIN-VALUE, then they are not displayed. AUTOSCALE directs SQR to calculate an appropriate minimum value.

X-AXIS-MAX-VALUE

AUTOSCALE | number

Specifies the maximum value on the axis. If data values exist that are greater than X- AXIS-MAX-VALUE, they are not displayed. AUTOSCALE directs SQR to calculate an appropriate maximum value.

Y-AXIS-MAX-VALUE

AUTOSCALE | number

Specifies the maximum value on the axis. If data values exist that are greater than Y- AXIS-MAX-VALUE, they are not displayed. AUTOSCALE directs SQR to calculate an appropriate maximum value.

X-AXIS-SCALE or Y-AXIS-SCALE

LOG | LINEAR

Specifies the scale for the axis. LOG specifies a logarithmic scale for the axis. Otherwise, the scale is linear.

X-AXIS-MAJOR-TICK- MARKS

YES | NO

Specifies whether to display tick-marks for major increments on the X-axis. If this argument is set to YES, tick-marks appear on 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.

Y-AXIS-MAJOR-TICK- MARKS

YES | NO

Specifies whether to display tick-marks for major increments on the Y-axis. If this argument is set to YES, tick-marks appear on 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.

X-AXIS-MINOR-TICK- MARKS

YES | NO

Specifies whether to display tick-marks for minor increments on the X-axis. If this argument is set to YES, tick-marks appear on 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.

Y-AXIS-MINOR-TICK- MARKS

YES | NO

Specifies whether to display tick-marks for minor increments on the Y-axis. If this argument is set to YES, tick-marks appear on 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.

X-AXIS-MAJOR-INCREMENT or Y-AXIS-MAJOR-INCREMENT

AUTOSCALE | number

Specifies, for SQR, the increment used for spacing the major tick-marks on the axis. AUTOSCALE directs SQR to determine an appropriate increment.

X-AXIS-MINOR-INCREMENT or Y-AXIS-MINOR-INCREMENT

number

Specifies, for SQR, the increment used for spacing the minor tick-marks on the axis. These arguments must be set for the X-AXIS- MINOR-TICK-MARKS and the Y-AXIS- MINOR-TICK-MARKS to appear.

X-AXIS-TICK-MARK- PLACEMENT or Y-AXIS-TICK-MARK- PLACEMENT

INSIDE | OUTSIDE | BOTH

Specifies where to place the tick-marks on the axis. INSIDE (or OUTSIDE) directs SQR to place the tick-marks on the inside (or outside) of the axis only. BOTH directs SQR to draw the tick-marks such that they appear on both sides of the axis.

X-AXIS-GRID or Y-AXIS-GRID

YES | NO

Specifies whether a grid line is drawn for each major tick-mark on the axis. If this argument is set toYES, a dashed grid line is drawn for each major tick-mark. If it is set to NO, no grid line is drawn on the axis.

Example

This code example declares a basic sales chart using DECLARE-CHART. 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

See The PRINT-CHART command

Specifying Chart Data Series Colors

Color palettes are used in the new graphics to set the colors of each data point in a data series. You specify the color palette to be used in a business chart by creating an SQR COLOR-PALETTE using the CREATE-COLOR-PALETTE command. The following code demonstrates how to create the color palette:

Create-Color-Palette
   Name = 'Test-Palette'
   Color_1 = (100,133,238)  
   Color_2 = (0, 0, 255)
   Color_3 = (0,255,0)
   Color_4 = (0,0,255)   
   Color_5 = (0,0,0)

Users can specify any number of palettes, with up to 64 colors defined in each palette. If more data points are in the data sets than are defined colors in the palette, the palette resets and continues to set the data point colors from Color_1 to Color_n.

After a color palette has been defined, it can be used within the DECLARE-CHART and PRINT-CHART commands to specify the color palette to be used. The following code example demonstrates the use of a color palette:

Print-Chart test_Chart
   COLOR-PALETTE = 'Test-Palette'

Specifying Chart Item Colors

Users can specify the foreground and background colors of the individual areas within a business chart using ITEM-COLOR = (rgb-value) within the DECLARE-CHART and PRINT-CHART commands. The following list shows chart item keywords that are valid for ITEM-COLOR:

  • 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 Subtitle.

  • HeaderForeground – Text color of the Title and Subtitle.

  • FooterBackground – Area within the text box specified for the X Axis label.

  • FooterForeground – Text color of the X Axis label.

  • 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.

  • PlotAreaForeground – Text and line colors of the plot area.