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

From MidrangeWiki
Jump to: navigation, search
(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...")
 
Line 9: Line 9:
 
==Screen Layout==
 
==Screen Layout==
  
a. This is the header as passed to the program
+
:a. This is the header as passed to the program
b. This is the Y-label, 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
+
: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.
+
: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
  
 
==Objects==
 
==Objects==
  
 
The following objects will be used by the program:
 
The following objects will be used by the program:
a. GENCHART#D Display File
+
:a. GENCHART#D - Display File
b. GENCHART#R – RPG Program
+
:b. GENCHART#R – RPG Program
  
  
 
==GenChart Program Parameters==
 
==GenChart Program Parameters==
 +
 
The GENCHART#R program requires the following parameters:
 
The GENCHART#R program requires the following parameters:
a. Data structure (see point 4):   
+
: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).
+
::- 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:   
+
:b. Heading:   
Char (100).  
+
::- Char (100).  
The heading you need for your chart
+
::- The heading you need for your chart
c. Y-Axis Label:   
+
:c. Y-Axis Label:   
Char(30)
+
::- Char(30)
Here you can specify a label for the Y-Axis.  
+
::- Here you can specify a label for the Y-Axis.  
Label will be affected by the Chart Type variable
+
::- Label will be affected by the Chart Type variable
d. Total Items:
+
:d. Total Items:
Int(10)
+
::- Int(10)
Specify the number of values to be passed via the DataStructure
+
::- Specify the number of values to be passed via the DataStructure
e. Max Value:
+
:e. Max Value:
Packed(31:2)
+
::- Packed(31:2)
Specify the Maximum value.  This is needed to determine the sizing of the bars
+
::- Specify the Maximum value.  This is needed to determine the sizing of the bars
f. Chart Type
+
:f. Chart Type
Char(10)
+
::- Char(10)
Allows for two types of charts.  Can be either  
+
::- Allows for two types of charts.  Can be either  
i. *PCT:  Determine %, betwee max value and actual value
+
:::* *PCT:  Determine %, betwee max value and actual value
ii. *NORMAL:  Display the values on the screen as they are
+
:::* *NORMAL:  Display the values on the screen as they are
g. Chart Calc:
+
:g. Chart Calc:
Char(10)
+
::- Char(10)
If the values are too big, the program can scale them.  Allowed values are:
+
::- If the values are too big, the program can scale them.  Allowed values are:
i. *NONE – Keep the values as is
+
:::* *NONE – Keep the values as is
ii. *TB – Scale the values in Terrabytes
+
:::* *TB – Scale the values in Terrabytes
iii. *GB – Scale the values in Gigabytes
+
:::* *GB – Scale the values in Gigabytes
iv. *KB – Scale the values in Megabytes
+
:::* *KB – Scale the values in Megabytes
v. *KB – Scale the values in Kilobytes
+
:::* *KB – Scale the values in Kilobytes

Revision as of 16:03, 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

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
  • *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