General Properties | Independent Variable & Annotations | Dependent Variables | Fonts and Sizes | Arithmetic String

The Graph Designer

The Graph Designer provides powerful functionality for editing and creating new graph styles. The tool is accessed from the Static Product Builder window. To launch the tool, select any graph style in the Product Styles list (Outputs tab) and click the Edit... button. Once the Graph Designer is launched, you can load a different graph style by clicking the Open button and selecting a graph style file (*.gph) from the dialog that displays.

Editing options for the selected graph style are presented in four tabs:

After you have completed your edits of the selected graph style, click the Save or Save As... button. In the file dialog, enter a new file name for the style and click the Save button.

NOTE: If the style you have loaded is a predefined file shipped with ODTK, the Save button is disabled, and you must use the SaveAs... button instead. This prevents accidental overwriting of the predefined graph styles.

General Properties

You can set the following parameters in the General Properties tab:

General Properties
Parameter Description
Title Enter a text string to serve as the title for the graph.
Axis Titles Enter text strings for the titles for the X and Y Axes and, if appropriate, the Secondary Y Axis.
X & Y Axis Scale To set the scale for the X and/or Y axis manually, select the Manual option and enter the desired values for Scale Unit, Maximum and Minimum.
X & Y Axis Unit To set the unit for the X and/or Y axis manually, select the Manual option and enter the desired values for Major and Minor. If the X axis is displaying Time, then the Manual settings will have no effect as the X axis units are determined automatically by the graphing software.
Secondary Y Axis Scale The ratio of the secondary to the primary Y axis. Select among:
  • User Defined - enter a numerical value representing the ratio of the secondary to the primary Y axis.
  • Database - select an appropriate criterion (a field from the table used for this graph).
  • Auto - set the scale automatically (the default option).
Database Settings These read-only fields display the Connection String for the appropriate database and a SQL Query String to specify table that the graph uses.
Read Only If this box is checked, the Data Editor cannot be used to change numerical inputs in the generated graph.
Show Events If this toggle is on, the default state, then Instantaneous and Finite Maneuvers will be displayed on the graph. These events are displayed as vertical line annotations at the corresponding time.
Add Logo If this box is checked, the AGI logo displays on the generated graph.

Independent Variable (X) & Annotations

This tab lets you define the independent (X) variable for the graph and set up annotations to appear on the graph.

Independent Variable (X) & Annotations
Parameter Description
Data Field Select the data field that supplies values to the independent variable. Available fields appear in the Database Table & Fields tree. Open the tree for the table (if it is not already open), select the desired field name and click the > button next to the Data Field box to move the field name into it.

NOTE: If a field name is already present in the Data Field box, it is replaced by the one you select.

Arithmetic Enter any arithmetic expressions to be applied to the independent variable. An arithmetic result of -777.7777 will cause the data point to be supressed.
Annotations Any number of annotations can be defined in a graph. They will all appear as concatenated lines in one annotation text box in the upper left hand corner of the graph. The text can just be a static note; i.e. it does not have to contain any variables.

To add your own annotations to the graph, click the Text button and then replace the dummy text string that appears in the Annotations field with your own text.

You can define only one variable to be used per annotation Text attribute. The variables are defined using the name of the database field in single quotes. The field must be in the same database table as the data in the independent and dependent graph variables. If there are multiple values found for the variables, they will be concatenated and the duplicates will be removed.

Dependent Variables (Y)

This tab lets you define dependent (Y) variables for the graph. Available dependent variables appear in a dropdown list in the Variable Name field. To rename a variable, select it, click the Rename Variable button and enter the new name in the dialog that displays. Add Variable and Delete Variable buttons are also provided.

To edit a variable's parameters, select it in the dropdown list. Various data and display parameters can be set for each dependent variable:

Dependent Variables (Y)
Parameter Description
Data Field Select the data field that supplies values to the dependent variable. Available fields appear in the Database Table & Fields tree. Open the tree for the table (if it is not already open), select the desired field name and click the > button next to the Data Field box to move the field name into it.

NOTE: If a field name is already present in the Data Field box, it is replaced by the one you select.

Group-By Fields This area is used to graph multiple series of the same type of data, e.g. the Range Residual values of multiple facilities. To assign a data field to this area, select it in the Database Tables & Fields area and move it with the > key. Any number of data fields can be assigned to the Group-By Fields area. To remove a data field from this area, select it and click the < or Delete key.
Select Field This optional field specifies which column of the database is used for filtering the data. Move the desired field name into this field with the > key.
Select Value Enter the value that the Select Field (above) must have in order to be included in the graph. Only one value is accepted.
Line Settings Set the desired Plot Type, Marker Type and Color to be used for the selected variable. Check the Secondary Y Axis checkbox to associate the variable with the secondary Y axis.

NOTE: Line width for solid lines can be specified using the Line Bold (2px) and Line Bold 3 (3px) settings in the Plot Type dropdown list.

Arithmetic Enter any arithmetic expressions to be applied to the dependent variable. An arithmetic result of -777.7777 will cause the data point to be supressed.

Fonts and Sizes

Title Font - Specify the font name and font attributes to be used in the title of the graph style.

Label Font - Specify the font name and font attributes to be used in the labels of the graph style. The label font will be used for all text except for the title.

Font Size - Specify the size of the font as Large, Medium, or Small. These display options can also be selected by right clicking the graph and selecting Font Size from the shortcut menu.

Point Size - Specify the size of the points on the graph as Large, Medium, Micro, or Small.

Legend Location - Specify the display location of the legend on the graph or select Hide to hide the legend from view. These display options can also be selected by right clicking the graph and selecting Legend Style from the shortcut menu.

Grid Lines - Specify the display of grid lines on the X, Y, or X and Y axes. Use the slide bar to set the shading of the grid lines.

Zero Lines - Specify the display of zero lines for X, Y, and Y2 axes on the graph.

This tab may be especially useful in designing graph styles which have fonts scaled for hard copy output.

The Arithmetic String

Arithmetic expressions used in the Graph Designer appear in statements of the form

result=<arithmetic expression>

where <arithmetic expression> can be any arithmetic expression defined above, with variable names enclosed in single quotes, for example:

result = 'Radial Pos Sigma' * 2

or in VBScript expressions containing one or more statements of the above form, such as:

if ('Bin Max' - 'Bin Min') * 100 then
   result = 'Bin Min' + ('Bin Max' - 'Bin Min') / 2
else
   result = 'Bin Min'
end if

NOTE: Most expressions that are legal in VBScript are allowed here, but with some restrictions. In particular, global and static variables cannot be declared. This means that summary information cannot be generated.

VBScript uses the built-in operators listed in the following table.

NOTE: Standard precedence rules apply.

VBScript Operators
Operator Function
^ Exponent
/ Division
* Multiplication
Mod Modulus
+ Addition
- Subtraction (and Negation)
= Assignment
< Less Than
<= Less Than or Equal To
> Greater Than
>= Greater Than or Equal To
= Equal To
<> Not Equal To
And Logical conjunction
Eqv Equivalence
Imp Implication
Not Logical negation
Or Logical disjunction (inclusive)
Xor Logical disjunction (exclusive)
& String concatenation

NOTE: The '=' comparison can be inaccurate due to floating point precision problems (e.g. "sqr(100)=10" probably returns 0, not 1).

Examples of function strings understood by the graph:

1+2
x-1
-sin(sqr(x^2+y^2))
sqr('Field Name1' * 'Field Name1' + 'Field Name2' * 'Field Name2')

An example of a recursive function is the factorial function:

if(n>1, n*eval(n-1), 1)

NOTE: A recursive call has some overhead that makes it a bit slower than any other operation. It may be a good idea to avoid recursive functions in very time-critical applications. Recursion also takes some memory, so that extremely deep recursions should be avoided (e.g. millions of nested recursive calls).

TIP: The if() function is the only place where making a recursive call is safe. In any other place it will cause an infinite recursion (which will make the program eventually run out of memory).

NOTE: To speedup generation of the consistency graphs we have implemented a built in C++ function to avoid calling the VBscript scripting engine for each point. Below is an example of this function as well as equivalent VBscript code that it replaces:

result = Builtin_Diff_vs_sigma_sqr(1e-5, 'Radial Pos Diff', 'Target Radial Pos Sigma', 'Reference Radial Pos Sigma')
Function Builtin_Diff_vs_sigma_sqr( epsilon, diff, targetSigma, referenceSigma )
Dim temp
Dim result
temp = 0
on error resume next
temp = abs(targetSigma^2 -referenceSigma ^2) 
if (temp > epsilon) then
    result = diff / sqr(temp)
else
    result = 0
end if
Builtin_Diff_vs_sigma_sqr = result
end function

ODTK 6.5