<<

Contents

Search

>>

 

GRAPHIC

 

 

Function

 

 

Syntax:

GRAPHIC(<Type>,<Print>,<Row>,<Column>,<Height>,<Width>,<Separator>,<Options>,<Design>,<Title>,

<Legend>,<Data Texts>,<Colors>,<X-Parameter>,<Y-Parameter>,<X-Values>,<Y-Values> [,<Handle>[, <Filename>]])

 

<Type>

= <STRING-EXPRESSION>

<Print>

= <NUM-EXPRESSION>

<Row>

= <NUM-EXPRESSION>

<Column>

= <NUM-EXPRESSION>

<Height>

= <NUM-EXPRESSION>

<Width>

= <NUM-EXPRESSION>

<Separator>

= <STRING-EXPRESSION>

<Options>

= <STRING-EXPRESSION>

<Design>

= <STRING-EXPRESSION>

<Title>

= <STRING-EXPRESSION>

<Legend>

= <STRING-EXPRESSION>

<Data Texts>

= <STRING-EXPRESSION>

<Colors>

= <STRING-EXPRESSION>

<X-Parameter>

= <STRING-EXPRESSION>

<Y-Parameter>

= <STRING-EXPRESSION>

<X-Values>

= <STRING-EXPRESSION>

<Y-Values>

= <STRING-EXPRESSION>

<Filename>

= <STRING-EXPRESSION>

 

 

Meaning:

Creates a graph (pie chart, bar chart, curve, line) and returns it on screen, on the printer or in a file.

 

GRAPHIC returns the following values:

 

0

The graph has been created successfully

7401

The chart does not fit into the rectangle

7402

Only <X-Parameter> or <Y-Parameter> allowed as text

7404

Invalid Separator

7405

Invalid legend

7406

Invalid type

7409

No image file specified

7410

Invalid size/ position

 

<Row> and <Column> specify the position and <Height> and <Width> the size of the area in which the graph is to be shown. With printing these parameters refer to the grid coordinates. (LPGRIDSETTING).

 

<Height> and <Width> are specified in rows and columns.

 

With <Print> = -1 and -2 <Height> and <Width> specify the size of the image in pixel. <Row> and <Column> specify the distance to the image margin in pixel.

 

Note: In the following section the semi-colon is used as <Separator> in order to improve readability. Wherever there is a semi-colon in the syntax notation the <Separator> is to be put instead.

 

Parameter:

Type

Specifies the type of the graph:

L = Line/curve

B = Bar

P = Pie

 

Print

Specifies where the graph is returned

0 = Return on screen

-1 = An image is created and saved in the file <Filename>.

-2 = An image is created an copied to the clipboard.

Otherwise = Printouts

 

Row

Row position of the upper left corner of the graph

 

Column

Column position of the upper left corner of the graph

 

Height

Height of the graph in rows resp. pixel

 

Width

Width of the graph in columns resp. pixel

 

Separator

Used to separate values within a parameter. The following characters are valid separators:

","

"+"

"-"

 "."

 "*"

CHR$(32) (Blank)

CHR$(10)

CHR$(13)

All letters

All numbers.

If the empty string "" is given, the semi-colon is used as separator.

 

Options

Only has a meaning with <TYPE> B and L.

<Typ> B:

<Options> = <3D>

<3D> = <Yes> or <No>

<Yes> = J or j or Y or y

<No> = N or n

With <3D> = <Yes> the bars are drawn 3-dimensional, otherwise 2-dimensional.

 

<Typ> L:

<Options> = <Width of Line><Separator>

                              <Interpolate><Separator>

                              <Square><Separator>

                              <Color>

<Width of Line> = <NUMBER>

<Interpolate> = <Yes> or <No>

<Square> = <Yes> or <No>

<Color> = <Yes> or <No>

<Width of Line> specifies the thickness of lines in pixel.

 

If <Interpolate> = <No>, the data points are linked by a straight line, otherwise the points between the data points are interpolated. If <Square> = <Yes> the data points are shown as square. 

 

 

<Color> = <Yes>:

The lines are labelled in the line color.

 

<Color> = <No>:

The lines are labelled in the standard color (black or white, depending on background or the <Text Color> specified in <Design>.

 

Design

The parameter <Design> has the following structure (<Separator> is ;):

 

<Background Color>;<Framing>;<Width of Axis>;<Black-White>;<Value Labeling>;<Value Lines>;<X-Labeling>;<X Lines>;<Text Height>;<Text Color>;<Text Font>;<Text Fontname>

 

Missing entries are replaced by default settings.

 

 

Default setting

<Background Color> = <Red>,<Green>,<Blue>

<Red> = <NUMBER>
<Green> = <NUMBER>
<Blue> = <NUMBER>

Window background

<Framing> = <Yes> or <No>

N

<Width of Axis> = <NUMBER>

1

<Black-White> = <Yes> or <No>

N with screen and color printer

J with B/W printer

<Value Labeling> = A or H or V

A

<Value Lines> = <NUMBER>

0

<X-Labeling> = A or H or V

A

<X Lines> = <NUMBER>

0

<Text Height> = <NUMBER>

9

<Text Color> = <Red>,<Green>,<Blue>

0,0,0
or
255,255,255
depending on background

<Text Font> = <Bold>,<Italic>,<Underlined>

<Bold> = <Yes> or <No>
<Italic> = <Yes> or <No>
<Underlined> = <Yes> or <No>

N,N,N

<Text Fontname> = <STRING>

Arial

 

<Background Color> specifies the background color of the graph.

 

If <Framing> = <Yes>, the graph is framed by a line.

 

<Width of Axis> specifies the thickness of the axis lines in pixel.

 

If <Black-White> = <Yes> the graph is shown in black&white, otherwise in color (if the output device supports color).

 

<Value Labeling> specifies the alignment of the value labeling: 

H = horizontal, V = vertical, A = automatic (This alignment is calculated so that the text takes as little space as possible and can be read easily.)

 

<Value Lines> specifies the number of lines for the <Value Labeling>. The program tries to display the labeling together with the specified line number. If this is not possible, for example because the text cannot be wrapped (text can be wrapped after a blank, CHR$(10) or CHR$(13)), a smaller number of lines is used. If <Value Lines> = 0, an optimal number of lines is calculated.

 

<X-Labeling> specifies the alignment of the labeling of the X-axis:

H = horizontal, V = vertical, A = automatic.

 

<X Lines> specifies the number of lines for the <X-Labeling>.

If <X Lines> = 0, an optimal line number is calculated.

 

<Text Height> specifies the height of the text font in points.

 

<Text Color> specifies the text color.

 

<Text Font> specifies the font type.

 

<Text Fontname> specifies the fontnames of the texts.

 

Title

The parameter <Title> has the following structure (<Separator> is ;):

<Text>;<Height>;<Color>;<Font>;<Fontname>

 

Missing entries are replaced by the default setting.

 

Default setting

<Text> = <STRING>

""

<Height> = <NUMBER>

<Text Height>

<Color> = <Red>,<Green>,<Blue>

<Text Color>

<Font> = <Bold>,<Italic>,<Underlined>

<Bold> = <Yes> or <No>

<Italic> = <Yes> or <No>

<Underlined> = <Yes> or <No>

<Text Font>

<Fontname> = <STRING>

<Text Fontname>

 

<Text> specifies the title of the graph.

 

<Height> is the height of the title in points.

 

<Color> specifies the color of the title.

 

<Font> specifies the font type of the title.

 

<Fontname> specifies the fontname of the title.

 

Legend

Specifies the position of the legend:

R = right
L = left
T = top
B = bottom
N = none

 

Data Texts

With the parameters <X-Values> and <Y-Values> several data series can be specified in the value representation (see below).

<Data Texts> specifies the texts for the data series that are displayed in the legend.

Colors

<Colors> has the following structure (<Separator> is ;):

<Red>,<Green>,<Blue> [;<Red>,<Green>,<Blue>]...

 

<Colors> specifies with bar charts only one data series and with pie charts the colors of the values (bars or ‚pieces’ of the pie), and with other graphs the colors of the single data series. 

 

X-Parameter

<X-Parameter> and <Y-Parameter> can be given as text T or as value V (<Separator> is ;):

 

Text representation:

T;<Grid Lines>;<Axis Labeling>;<Value Labeling>

 

 

Default setting

 

<Grid Lines> = <Yes> or <No>

N

 

<Axis Labeling> = 0 or 1 or 2

0

 

<Value Labeling> = <Yes> or <No>

N

 

Missing entries are replaced by the default settings.

 

The text representation is selected if the axis scale is labeled with texts (e.g. sales Jan, sales Feb, ...). The value representation is used if the axis scale is to be labeled with numbers or percentages that refer to the values <Value_ij>.

 

With bar charts the text representation specifies whether the bars are displayed in portrait or landscape format: If <X-Parameter> is specified in the text format, the bars are shown in portrait format. If <Y-Parameter> is in text format and <X-Parameter> in value format, the bars are shown in landscape format. If <X-Parameter> and <Y-Parameter> are in text format, no bars but only points are shown, since there are no values that specify the size of the bars. 

 

With <Grid Lines> = <Yes> gridlines are drawn through the axis points.

 

The <Axis Labeling> specifies the labeling of the axes:

 

0

1

other

No label

Left or bottom

Left and right or bottom and top

 

In the text representation the axes are labeled with the texts <Text-i>.

If <Value Labeling> = <Yes>, the graph elements are labeled with he texts <Text-i>, otherwise there is no labeling.

 

Value representation:

V;<Grid Lines>;

<Axis Labeling>;

<Suffix Axis Labeling>;

<Axis Labeling PDP>;

<Minimum Axis Value>;

<Maximum Axis Value>;

<Axis Fragmentation>;

<Value Labeling>;

<Prefix-Value Labeling>;

<Suffix-Value Labeling>;

<Value Labeling-NKS>;

<Percent Labeling>;

<Suffix Percent Labeling>;

<Percent Labeling PDP>

 

 

Default setting

 

<Grid Lines> = <Yes> or <No>

N

 

<Axis Labeling> = 0 or 1 or 2

0

 

<Suffix Axis Labeling> = <STRING>

""

 

<Axis Labeling PDP> = <NUMBER>

0

 

<Minimum Axis Value> = <NUMBER>

being calculated

 

<Maximum Axis Value> = <NUMBER>

being calculated

 

<Axis Fragmentation> = <NUMBER>

1

 

<Value Labeling> = <Yes> or <No>

N

 

<Prefix-Value Labeling> = <STRING>

""

 

<Suffix-Value Labeling>= <STRING>

""

 

<Value Labeling-NKS> = <NUMBER>

0

 

<Percent Labeling> = <Yes> or <No>

N

 

<Suffix Percent Labeling> = <STRING>

""

 

<Percent Labeling PDP> = <NUMBER>

0

 

Missing entries are replaced by the default settings.

 

The value representation is used if the axis scale is to be labeled with numbers or percentages that refer to the values <Value_ij>.

 

With <Grid Lines> = <Yes> gridlines are drawn through the axis points.

 

The <Axis Labeling> specifies how the axes are to be labeled:

 

0

1

other

No label

Left or bottom

Left and right or bottom and top

 

In the text representation the axes are labeled with the texts <Text-i>, in the value representation they are labeled with the values that are specified by <Minimum Axis Value>, <Maximum Axis Value> and <Axis Fragmentation>. 

 

<Suffix Axis Labeling> is a character string that is displayed behind the scale value.

 

<Axis Labeling PDP> specifies the number of post decimal positions of the values on the axis scale. The values are shown rounded.

 

<Minimum Axis Value> and <Maximum Axis Value> specify the smallest and biggest value of the axis scale. The smallest value is shown on the left or at the bottom, and the biggest value is shown on the right or at the top. <Axis Fragmentation> specifies in how many sections the axis is divided. That means that there are <Axis Fragmentation> - 1 values between the minimum and maximum value at regular distances on the axis.

 

With <Value Labeling> = <Yes> the values are labeled with <Value_ij>, with <Percent Labeling> = <Yes> they are labeled with percentages.

 

<Prefix-Value Labeling> is a character string displayed before the value or the percentage if  <Value Labeling> = <Yes> and/or <Percent Labeling> = <Yes>.

 

With <Suffix-Value Labeling> a character string can be specified, which is displayed after <Value_ij> if <Value Labeling> = <Yes> .

 

<Value Labeling-NKS> and <Percent Labeling PDP> specify the number of post decimal positions with which <Value_ij> or the percentages are displayed.

 

<Suffix Percent Labeling> is a character string which is displayed after the percentage if <Percent Labeling> = <Yes>.

 

Y-Parameter

See X-Parameter

 

X-Values

The parameters <X-Values> and <Y-Values> contain the function values.

 

With the text representation the texts are to be specified in the following format:

<Text-1>;<Text-2>...;<Text-n>

<Text-i> = <STRING>

 

With the value representation the following syntax is to be used: <Value_11>,<Value_12>,...,<Value_1r>;
<Value_21>,<Value_22>,...,<Value_2r>;
...
<Value_n2>,...,<Value_nr>

<Value_ij> = <NUMBER>

(r = number of data series, n = number of values)

 

With the value representation several data series can be specified. With the horizontal representation this means that there can be several Y-Values with each X-Value. Analogously, with the vertical representation several X-Values can be assigned to one y-Value. The series <Value_1j> ... <Value_nj> (n = number of values) is called data series j. Any number of data series can be defined. <Data series texts> specifies the texts for the single data series, which are shown in the legend.

 

The values <Value_ij> must be arranged in the following way: First the first values of each data series separated by commas, then the Separator, then the second values of each data series separated by commas, etc.

 

With the pie chart only the first data series is used, all further data series are ignored.

 

With <Value_ij> an asterix "*" can be added. With pie charts the respective ‘piece’ then appears pushed forward.

 

With all <...-PDP> parameters a leading "+" character can be added. With positive values the "+" sign is then shown as well.

 

Y-Values

See X-Values

 

Handle

Window depth or handle of a split window or handle of a WINDOWCALL Window

 

 

Filename

Specifies with <Print> = -1 the filename in which the image is saved.

 

Sample:

H% = GRAPHIK("P",                                  /* <Type>

              0,                                   /* <Print>

              5,                                   /* <Row>

              2,                                   /* <Column>

              11,                                  /* <Height>

              35,                                  /* <Width>

              ";",                                 /* <Separator>

              "",                                  /* <Options>

              "192,192,192;J",                     /* <Design>

              "Umsatzentwicklung 1998;12;;J;Times" /* <Title>

              "B",                                 /* <Legend>

              "",                                  /* <Data Texts>

              "255,0,0;0,255,0;0,0,255;255,255,0", /* <Colors>

              "T;N;1;N",                           /* <X-Parameter>

              "V;;;;;;;;;;;;J",                    /* <Y-Parameter>

              "I/1998;II/1998;III/1998;IV/1998",   /* <X-Values>

              "20;40;30;60")                       /* <Y-Values>

 

IF H% <> 0

THEN ... Error ...

ENDIF

 

Damit wird folgende Grafik erzeugt:

 

 

H% = GRAPHIC("B",                                     /* <Type>

              0,                                      /* <Print>

              2,                                      /* <Row>

              2,                                      /* <Column>

              14,                                     /* <Height>

              50,                                     /* <Width>

              ";",                                    /* <Separator>

              "J",                                    /* <Options>

              ";J;1;;A;0;A;0;7;;N,N,N;MS Sans Serif", /* <Design>

              "Umsatz;15;0,0,128;Y,Y,N;Arial",        /* <Title>

              "R",                                    /* <Legend>

              "Hardware;Software;Dienstl.;Zubehör;"+  /* <Data Texts>

              "Wartung;Support;sonstiges",

              "128,0,0;0,0,0;128,0,128;128,64,0;"+    /* <Colors>

              "0,128,0;0,0128;64,64,64",

              "T;N;1;N",                              /* <X-Parameter>

              "V;Y;1;%;0;0;40;4;N;;;1;N;;1",          /* <Y-Parameter>

              "1997;1998",                            /* <X-Values>

              "34.0,34.4,19.9,4,5.1,3.6,3.0;"+        /* <Y-Values>

              "35.9,22,19.6,12.9,3.2,4.2,2.2")

 

IF H% <> 0

THEN ... Error ...

ENDIF

 

Damit wird folgende Grafik erzeugt:

 

 

See also:

REMOVE_GRAPHIK