Printing Charts

The PRINT-CHART commands are based on the orders-stacked-bar chart that was declared in the preceding section.

  print-chart orders-stacked-bar (+2,1)
    data-array=order_qty
    data-array-row-count=12
    data-array-column-count=4
    data-array-column-labels=('Jan','Feb','Mar')
sub-title='By Product By Month'
  new-page
  print-chart orders-stacked-bar (+2,1)
    data-array=order_qty2
    data-array-row-count=3
    data-array-column-count=4
    data-array-column-labels=('Jan','Feb','Mar')
    sub-title='By Price Category By Month'

The data source is specified by using the DATA-ARRAY option. The named array has a structure that is specified by the TYPE option. For a stacked-bar chart, the first field in the array gives the names of the categories for the bars. The rest of the fields are series of numbers. In this case, each series corresponds to a month.

The subtitle follows the title and can be used as a second line of the title. A legend labels the series. The DATA-ARRAY-COLUMN-LABELS argument passes these labels. The DATA-ARRAY-ROW-COUNT argument is the number of rows (bars) to chart and DATA-ARRAY-COLUMN-COUNT is the number of fields in the array that the chart uses. The array has four fields: the product (or price category) field and the series that specifies three months.