home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume27 / conv123 / part01 / grph123.doc < prev    next >
Encoding:
Text File  |  1993-09-05  |  14.8 KB  |  368 lines

  1.  
  2.  
  3. NAME
  4.     graph 123 - The ASCII to Lotus/123(TM) named graph converter
  5.  
  6. SYNOPSIS
  7.     grph123 filename [outputfile]
  8.  
  9. INTRODUCTION
  10.     grph123 is a utility for reading a specially-formatted flat
  11.     ASCII file and converting it into a Lotus/123(TM) ".WK1" file.
  12.     Each set of specially-formatted ASCII data creates one "named
  13.     graph" record, and stores the data for the named graph in a
  14.     spreadsheet file, which may therefore contain multiple named
  15.     graphs.  This spreadsheet file is in its final, directly-
  16.     readable binary form, and need undergo no further translation
  17.     or conversion before being read directly by Lotus/123(TM).  This
  18.     feature makes grph123 especially suited to networked environments,
  19.     where report writers or programs running on transaction processing
  20.     machines can easily and directly create spreadsheet/graph output,
  21.     instantly ready for copying, downloading, or direct access in the
  22.     MS-DOS(TM) or Macintosh(TM) environments.  Control of most of
  23.     the Lotus(TM) named graph features is allowed.  Familiarity with
  24.     the graph function of Lotus/123(TM) will help greatly in under-
  25.     standing this utility.
  26.  
  27. OPTIONS
  28.     There are currently no command-line options for grph123.
  29.  
  30. PARAMETERS
  31.     The only parameters are the input file name (required) and an
  32.     optional output file name.  If the output file name is not
  33.     supplied, output is sent to stdout, and may therefore be re-
  34.     directed.  grph123 cannot currently be used as a filter, i.e.,
  35.     have its input "piped" to it.
  36.  
  37. INPUT FILE FORMAT
  38.     Each line of the input file has a one-character "type" at the
  39.     start of the line, followed by the data values suitable for that
  40.     "type" of line.  Each graph entry must have an "n"-type record,
  41.     at least one "d"-type record, and an "e"-type record, in that
  42.     order.  All "d" (data)-type records for each graph should be 
  43.     together, each "L"-type record must follow the associated "d"-type
  44.     record, and all records for each graph must be contiguous.
  45.     Besides these restrictions (easy ones for report writers to
  46.     meet), record order is not significant to the utility.  This
  47.     can be an advantage if, for example, you wish to place the
  48.     record controlling the x-axis or y-axis scale _after_ the data,
  49.     when you most conveniently know the minimum and maximum values.
  50.  
  51.     grph123 attempts to understand each input line as well as it can,
  52.     and ignores blank or null records, and white space at the beginning
  53.     or end of a record, or in-between data values.  Input records that
  54.     have incorrect or insufficient data are ignored, and the Lotus/123(TM)
  55.     defaults are used (see DEFAULTS section below).  If string values
  56.     have embedded blanks, they must be surrounded by double quotes
  57.     ("like this").
  58.  
  59.     Following is a description of each record type, followed by some
  60.     examples.  The "record type" is the letter that must be the first
  61.     field of each input record.  "Max size" is the maximum size (in
  62.     bytes) of the field following.  If more than the maximum number
  63.     of characters is supplied, grph123 usually truncates the input.
  64.  
  65.     Record Max
  66.     Type   Size                    Meaning
  67.     ------ ----  --------------------------------------------------
  68.       n     15   This is the "name" record type, and is one of the
  69.                  required types.  The string value following is
  70.                  placed into the Lotus/123(TM) graph record as
  71.                  its name, which means that it appears on the
  72.                  circular menu after the Graph/Name/Use sequence.
  73.  
  74.       Example:   n "Durable Ships"
  75.  
  76.  
  77.       T     39   This the "main title" of the graph, and appears at
  78.                  the top of the graph, above the subtitle (if any).
  79.  
  80.       Example:   T "SHIPMENTS OF DURABLE GOODS"
  81.  
  82.  
  83.       t     39   This the "subtitle" of the graph, and appears at
  84.                  the top of the graph, below the main title.
  85.  
  86.       Example:   t "Monthly for 1991"
  87.  
  88.  
  89.       b     39   This the "bottom title" of the graph, and appears at
  90.                  the bottom of the graph, below the x-axis values
  91.                  on a non-pie chart.
  92.  
  93.       Example:   b "Month"
  94.  
  95.  
  96.       s     39   This the "side title" of the graph, and appears
  97.                  90-degrees rotated at the side of a non-pie chart,
  98.                  to the left of the y-axis.
  99.  
  100.       Example:   s "Dollars"
  101.  
  102.  
  103.       g          The "g" type record is an important one, and could
  104.                  be thought of as the "g)raph control" record.  Up to
  105.                  four fields may be specified on this record, which
  106.                  must be IN THIS ORDER (i.e., if you wish to specify
  107.                  the fourth field, the first three MUST ALSO be
  108.                  specified):
  109.  
  110.                  g [graph type] [grid control] [color control] [skip factor]
  111.  
  112.                  [graph type] is one of L)INE, B)AR, P)IE, S)TACKED-BAR, or
  113.                  X)Y.  Note that only the first letter of each field is
  114.                  actually significant and required, and that case is ignored.
  115.                  This makes the examples: g line, g L, and g loquat
  116.                  equivalent expressions; the first example is preferred
  117.                  for clarity.  The default graph type is LINE.
  118.  
  119.                  [grid control] is one of n)one, h)orizonal, v)ertical, or
  120.                  b)oth.  The default grid control is NONE, or no grid.
  121.  
  122.                  [color control] is either of b)lack&white or c)olor.  If
  123.                  c)olor is specified, and the monitor being used is a
  124.                  color monitor, then each individual data range will be
  125.                  displayed in a different color.  The default color control
  126.                  is B)&W, or no color.
  127.  
  128.                  [skip factor] is an integer from 1 to 256, and is the
  129.                  number of values to skip between labeled data points.
  130.                  The default is (usually) no skipping.
  131.  
  132.       Example:   g line horizontal color 2
  133.  
  134.  
  135.       f          The "f" type record is the line f)ormat record, and
  136.                  is used to control the appearance of the line displayed
  137.                  on each of the six ranges allowed by Lotus/123(TM).
  138.                  There are, therefore, up to six values allowed on
  139.                  the record, controlling the appearance of lines on
  140.                  a LINE or XY graph.  The format of the "f"-type
  141.                  record is as follows:
  142.  
  143.                  f [line format]... [line format] (up to 6 times)
  144.  
  145.                  [line format] is one of n)one, l)ine, s)ymbol, or
  146.                  b)oth line and symbol.  The line format will be
  147.                  carried to the legend.  Here is an example of a
  148.                  line format record controlling three data ranges:
  149.  
  150.       Example:   f line line both
  151.  
  152.  
  153.       l     19   The "l" type record is the l)egend record, and is
  154.                  is used to define the text labeling displayed for
  155.                  each line example of the six ranges allowed by
  156.                  Lotus/123(TM).  There are, therefore, up to six
  157.                  string values allowed on the record, each a maxi-
  158.                  mum of 19 characters.
  159.                  The format of the "l"-type record is as follows:
  160.  
  161.                  l [legend string]... [legend string] (up to 6)
  162.  
  163.                  [legend string] is a delimited string of up to
  164.                  19 characters.
  165.  
  166.       Example:   l "30 days" "60 days" "90 days"
  167.  
  168.  
  169.       L          The "L"-type record is the L)abel record, and is
  170.                  is used to define the text labeling displayed for
  171.                  each data line of the six ranges allowed by
  172.                  Lotus/123(TM).  There are, therefore, up to six
  173.                  string values allowed on the record.  Each of these
  174.                  values is actually placed in the spreadsheet, so
  175.                  they may be of arbitrary length; however, they will
  176.                  be placed in the data row at the end of the y-axis
  177.                  data in columns of default length, so they may not
  178.                  be entirely visible when the spreadsheet is viewed.
  179.                  (See the "a"-type record below for information on
  180.                  how to orient the values around the data point(s)
  181.                  on the actual graph.)
  182.  
  183.                  It is possible to label EVERY data point on a graph.
  184.                  Each "L"-type record MUST follow the associated
  185.                  data record.  "L"-type records out of order will be
  186.                  ignored.  Each string value on the line matches
  187.                  the corresponding data point on the previous data
  188.                  record; therefore, if the earlier values (the ones
  189.                  toward the left of the line) are not to be labeled,
  190.                  their places must be held by a null string, represented
  191.                  by contiguous double quotes ("").
  192.  
  193.                  The format of the "L"-type record is as follows:
  194.  
  195.                  L [label string]... [label string] (up to 6)
  196.  
  197.                  [label string] is a delimited string, and must have
  198.                  double quotes surrounding the value if there are
  199.                  embedded blanks.
  200.  
  201.       Example:   L 14.5 "" "not known" "15.90"
  202.  
  203.  
  204.       a          The "a" type record is the label a)lignment record, and
  205.                  is used to control the position of the labels created
  206.                  by the "L"-type record for line or XY graphs.  Up to six
  207.                  values are allowed, each value controlling the display
  208.                  position of a data label range.
  209.  
  210.                  The format of the "a"-type record is as follows:
  211.  
  212.                  a [alignment]... [alignment] (up to 6 times)
  213.  
  214.                  [alignment] is one of c)enter, l)eft, r)ight, a)bove,
  215.                  or b)elow.
  216.  
  217.       Example:   a above below
  218.  
  219.  
  220.       d          The "d" type record is the d)ata record, and is
  221.                  one of the required types.  Each line of this
  222.                  record should contain a minimum of two values, an
  223.                  x-axis value and a y-axis value (independent and
  224.                  dependent variables).  Since Lotus/123(TM) allows
  225.                  up to six "data ranges" (dependent variables), each
  226.                  data record may contain up to seven values, one
  227.                  x-axis value and up to six y-axis values.
  228.               
  229.                  The format of the "d"-type record is as follows:
  230.  
  231.                  d [x-axis value] [y-axis value]... (up to 6 y-axis values)
  232.  
  233.                  The x-axis values are string values for all types of
  234.                  graphs except the XY graph, where x-axis values are
  235.                  numeric.  X-axis string values follow the same rules
  236.                  as other string values, but should not exceed about
  237.                  12 characters or so, as they will start to crowd the
  238.                  visual output (you may wish to experiment with the
  239.                  skip factor in those cases).
  240.  
  241.       Example:   d "Jan" 5000000.00 7300000.00
  242.  
  243.  
  244.       p          The "p" type record is the decimal p)laces record, and
  245.                  is used to control the numer of decimal places in each
  246.                  dependent data range created by the "d"-type record.  Up
  247.                  to six integer values are allowed.
  248.  
  249.                  The format of the "p"-type record is as follows:
  250.  
  251.                  p [decimal places]... (up to 6 times)
  252.  
  253.                  [decimal places] is a decimal integer in the range 0
  254.                  to 6.  Integers below 0 or above six will be set at
  255.                  0 and 6 respectively.
  256.  
  257.       Example:   p 3 3
  258.  
  259.  
  260.       y          The "y" type record is the y)-axis min/max record, and
  261.                  is used to control the "scale" of the graph when the
  262.                  automatic scaling is insufficient or too inconsistent.
  263.                  There are two numeric values expected.
  264.  
  265.                  The format of the "y"-type record is as follows:
  266.  
  267.                  y [min value] [max value]
  268.  
  269.                  [min value] and [max value] are decimal numbers.
  270.  
  271.       Example:   y 2000000.0 15000000
  272.  
  273.  
  274.       x          The "x" type record is the x)-axis min/max record, and
  275.                  is used to control the "scale" of the graph when the
  276.                  automatic scaling is insufficient or too inconsistent.
  277.                  There are two numeric values expected.  Use some
  278.                  caution when specifying x-axis min and max values
  279.                  on non-XY graphs.
  280.  
  281.                  The format of the "x"-type record is as follows:
  282.  
  283.                  x [min value] [max value]
  284.  
  285.                  [min value] and [max value] are decimal numbers.
  286.  
  287.       Example:   x 10.0 45.0
  288.  
  289.  
  290.       e          The "e" type record is an important and required one,
  291.                  as it triggers actual graph record creation.  It MUST
  292.                  appear after all other graph information, and will
  293.                  reset internal flags in preparation for the next set
  294.                  of graph information.
  295.  
  296.       Example:   e 
  297.  
  298.  
  299.       #          The "#" type record is a comment record; any values
  300.                  may follow up to the end-of-line.
  301.  
  302.       Example:   # This is a comment record
  303.  
  304.  
  305. MISSING VALUES
  306.     For the purposes of this utility, a missing value may be defined by
  307.     any value less than or equal to -2000000000.00 (minus two thousand
  308.     million).
  309.  
  310. SPECIAL CONSIDERATIONS FOR PIE CHARTS
  311.     Although grph123 will accept multiple data ranges for pie graphs,
  312.     Lotus/123 makes use of only the A and B data ranges, with the
  313.     B data range controlling shading (or color if the color flag is 
  314.     on and a color monitor is used) and explosion.  The X-axis
  315.     values are used as labels, and percentages are displayed auto-
  316.     matically.  The bottom and side titles are not used.
  317.  
  318. FILE EXAMPLE
  319.     Here is an example of a file that defines two graphs.  The first is
  320.     a line graph, and the second is a pie graph.  Note that in the first
  321.     graph example, the first x-axis value is in double quotes, and the
  322.     following ones are not; both are interpreted exactly the same way,
  323.     since there are no embedded blanks.  In addition, there are two
  324.     "data ranges" (dependent variables) in the first graph example,
  325.     and all values are displayed with two decimal places, regardless
  326.     of input format.
  327.  
  328.     In the second (pie chart) example, the five slices of the pie are
  329.     shaded in colors 1 through 5, with slice three exploded.
  330.  
  331. # First, a line graph
  332. n "30-60-90 graph1"
  333. T "SUMMARY BACKLOG BY WEEK"
  334. t "30-60-90 days"
  335. b "Manufacturing Wk"
  336. s "Dollar"
  337. g line horizontal b&w 2
  338. f both both
  339. l "30 day" "60 day"
  340. a above above
  341. d "9039" 6533515.10 14500000
  342. L           6.53      14.5
  343. d 9040 6229610.10 14220000
  344. L       labelit  "label it"
  345. d 9042 7685293.90 14500000
  346. d 9043 10008108.35 15800000
  347. p 2 2
  348. y 5000000 18000000
  349. e
  350. #
  351. # Now, a pie graph
  352. #
  353. n "Sales by Terr"
  354. T "SALES BY TERRITORY"
  355. t "August 1992"
  356. g PIE none color
  357. d widgets 45000 1
  358. d loffles 53000 2
  359. d scouse 50000.17 103
  360. d framjits 63000 4
  361. d gopples 77342 5
  362. p 2 0
  363. e
  364.  
  365. BUGS
  366. grph123 should be able to run as a filter.
  367. Tabs as delimiters do not behave consistently.
  368.