Difference between revisions of "Green-screen Chart/Graph"

From MidrangeWiki
Jump to: navigation, search
(Screen Layout)
(Screen Layout)
Line 17: Line 17:
 
: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.
 
: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
 
:e. If you position your cursor on any data item/column, and press F1, the program  will display information about the data point
 +
 +
[[File:GenChart_-_Item_Information.png]]
  
 
==Objects==
 
==Objects==

Revision as of 16:29, 8 June 2021

=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

GenChart - Overview.png

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

GenChart - Item Information.png

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
  • *PCT: Determine %, betwee max value and actual value
  • *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:
  • *NONE – Keep the values as is
  • *TB – Scale the values in Terrabytes
  • *GB – Scale the values in Gigabytes
  • *KB – Scale the values in Megabytes
  • *KB – Scale the values in Kilobytes