Defining Charts

The two chart sections in the ex13a.sqr program are specified with the DECLARE-CHART command in the SETUP section and are named orders-stacked-bar. The width and height of the charts are specified in terms of character cells. The charts that are generated by this program are 70 characters wide, which is 7 inches on a default layout. The height of the charts is 30 lines, which translates to 5 inches at 6 lines per inch. These dimensions define a rectangle that contains the chart. The box that surrounds the chart is drawn by default, but you can disable it by using the qualifier BORDER=NO.

The title is centered at the top of the chart. The text that is generated by LEGEND-TITLE must fit inside the small legend box that precedes the categories, so make this description short. Generally, charts look best when the text items are short. Here is the DECLARE-CHART command:

declare-chart orders-stacked-bar
    chart-size=(70,30)
    title='Order Quantity'
    legend-title='Month'
    type=stacked-bar
  end-declare ! orders-stacked-bar

The heading prints only on the first page.