Green-screen Chart/Graph

From MidrangeWiki
Revision as of 10:55, 8 June 2021 by Phenrico (talk | contribs) (Created page with "=Green-screen Chart/Graph ==Background== It is sometimes useful to display a graph of values on the AS400 green-screen. Although there are commercial products available for...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

=Green-screen Chart/Graph

Background

It is sometimes useful to display a graph of values on the AS400 green-screen. Although there are commercial products available for the AS400, these are often difficult to use and not available everywhere. This product was designed to allow for a simple text-based line-graph to be displayed on the screen. It will take a data-structure from another program, and build up the screen accordingly.

The program has been written to work correctly on either a wide screen (27x132) or a normal screen(24x80).

Screen Layout

a. This is the header as passed to the program b. This is the Y-label, as passed to the program c. The Y-axis values will be build based on the chart type or the chart calc function d. If the number of data points exceed the screen width, the program will create additional pages. Page Up/Down will show the rest of the entries. If you want to jump to the 1st page, press F17, or last page press F18. e. If you position your cursor on any data item/column, and press F1, the program will display information about the data point

Objects

The following objects will be used by the program: a. GENCHART#D – Display File b. GENCHART#R – RPG Program


GenChart Program Parameters

The GENCHART#R program requires the following parameters: a. Data structure (see point 4): • The data structure will be passed from your program, to the GENCHART#R program, by using pointers. When you call the program, the variable has to use %ADDR(DSNAME). b. Heading: • Char (100). • The heading you need for your chart c. Y-Axis Label: • Char(30) • Here you can specify a label for the Y-Axis. • Label will be affected by the Chart Type variable d. Total Items: • Int(10) • Specify the number of values to be passed via the DataStructure e. Max Value: • Packed(31:2) • Specify the Maximum value. This is needed to determine the sizing of the bars f. Chart Type • Char(10) • Allows for two types of charts. Can be either i. *PCT: Determine %, betwee max value and actual value ii. *NORMAL: Display the values on the screen as they are g. Chart Calc: • Char(10) • If the values are too big, the program can scale them. Allowed values are: i. *NONE – Keep the values as is ii. *TB – Scale the values in Terrabytes iii. *GB – Scale the values in Gigabytes iv. *KB – Scale the values in Megabytes v. *KB – Scale the values in Kilobytes