The Graph class gives you access to graphs in T/HIS. More...
The T/HIS JavaScript API provides many class constants, properties and methods. For Arup to
be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase
or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you
should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your
own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:
| Name | Description |
| Graph.AXIS_LINEAR | Linear axis type |
| Graph.AXIS_LOG | Logarithmic axis type |
| Graph.FONT_COURIER_BOLD | Courier bold font |
| Graph.FONT_COURIER_MEDIUM | Courier medium font |
| Graph.FONT_DEFAULT | Takes the font defined in the preference file |
| Graph.FONT_HELVETICA_BOLD | Helvetical bold font |
| Graph.FONT_HELVETICA_MEDIUM | Helvetical medium font |
| Graph.FONT_SIZE_10 | 10 point font size |
| Graph.FONT_SIZE_12 | 12 point font size |
| Graph.FONT_SIZE_14 | 14 point font size |
| Graph.FONT_SIZE_18 | 18 point font size |
| Graph.FONT_SIZE_24 | 24 point font size |
| Graph.FONT_SIZE_8 | 8 point font size |
| Graph.FONT_SIZE_AUTO | Font size would be automatically adjusted based on the graph area |
| Graph.FONT_TIMES_BOLD | Times New Roman bold font |
| Graph.FONT_TIMES_MEDIUM | Times New Roman medium font |
| Graph.GRID_OFF | Turn off the grid. |
| Graph.GRID_ON | Turn on the grid. |
| Graph.LEGEND_1_COLUMN | Curve labels will be displayed in a single column in the legend |
| Graph.LEGEND_2_COLUMN | Curve labels will be displayed in two columns in the legend |
| Graph.LEGEND_AUTO | Automatic legend layout (see Legend) |
| Graph.LEGEND_COLUMN_LIST | Column list legend layout (see Legend) |
| Graph.LEGEND_FLOATING | Floating legend layout (see Legend) |
| Graph.LEGEND_OFF | Off legend layout (see Legend) |
| Graph.NO | Flag for no. |
| Graph.OFF | Flag to turn off. |
| Graph.ON | Flag to turn on. |
| Graph.PREFIX_AUTO | Automatically add prefix to the curve label in the legend (see Legend) |
| Graph.PREFIX_DIR | Directory name of the model will be used as the curve label prefix in the legend (see Legend) |
| Graph.PREFIX_MODEL_NUMBER | Model number will be used as the curve label prefix in the legend (see Legend) |
| Graph.PREFIX_OFF | Turn off the curve label prefix in the legend (see Legend) |
| Graph.PREFIX_ON | Add prefix to the curve label in the legend (see Legend) |
| Graph.PREFIX_THF | Root name of the THF file will be used as the curve label prefix in the legend (see Legend) |
| Graph.PREFIX_USER_DEFINED | A user defined prefix will be used as the curve label prefix in the legend (see Legend) |
| Graph.YES | Flag for yes. |
| Name | Type | Description |
| active | constant | If the graph is active or inactive. Can take Graph.YES or Graph.NO |
| add_x_units | constant | shows x-axis units. It can take either Graph.ON or Graph.OFF |
| add_y2_units | constant | shows second y-axis units. It can take either Graph.ON or Graph.OFF |
| add_y_units | constant | shows y-axis units. It can take either Graph.ON or Graph.OFF |
| auto_title | string | Turn on to set graph title automatically and turn off to define the graph title manually using the property Graph.title. Can take either Graph.ON or Graph.OFF |
| auto_xlabel | constant | Turn on to set label for the x-axis automatically and turn off to define the label for the x-axis manually using the property xlabel. Can take either Graph.ON or Graph.OFF |
| auto_xmax | constant | Can take either Graph.ON or Graph.OFF. Graph.ON will set the maximum value for the y-axis range automatically and Graph.OFF will use the property xmax value as the maximum value for the x-axis range |
| auto_xmin | constant | Can take either Graph.ON or Graph.OFF. Graph.ON will set the minimum value for the x-axis range automatically and Graph.OFF will use the property xmin value as the minimum value for the x-axis range |
| auto_y2label | constant | Turn on to set label for the second y-axis automatically and turn off to define the label for the second y-axis manually using the property y2label. Can take either Graph.ON or Graph.OFF |
| auto_y2max | constant | Can take either Graph.ON or Graph.OFF. Graph.ON will set the maximum value for the second y-axis range automatically and Graph.OFF will use the property y2max value as the maximum value for the second y-axis range |
| auto_y2min | constant | Can take either Graph.ON or Graph.OFF. Graph.ON will set the minimum value for the second y-axis range automatically and Graph.OFF will use the property y2min value as the minimum value for the second y-axis range |
| auto_ylabel | constant | Turn on to set label for the y-axis automatically and turn off to define the label for the y-axis manually using the property ylabel. Can take either Graph.ON or Graph.OFF |
| auto_ymax | constant | Can take either Graph.ON or Graph.OFF. Graph.ON will set the maximum value for the y-axis range automatically and Graph.OFF will use the property ymax value as the maximum value for the y-axis range |
| auto_ymin | constant | Can take either Graph.ON or Graph.OFF. Graph.ON will set the minimum value for the y-axis range automatically and Graph.OFF will use the property ymin value as the minimum value for the y-axis range |
| background_colour | Colour | Graph background colour |
| foreground_colour | Colour | Graph foreground colour |
| grid | constant | To turn on/off the grid. Can take Graph.GRID_ON or Graph.GRID_OFF |
| id (read only) | integer | Graph ID |
| legend_background_colour | Colour | Background colour for the legend area |
| legend_background_trans | integer | Transparancy of the legend area. The value should lie between 0 and 100 |
| legend_font | constant | Font for the curve labels in the legend. Can take either Graph.FONT_DEFAULT, Graph.FONT_HELVETICA_MEDIUM, Graph.FONT_HELVETICA_BOLD, Graph.FONT_TIMES_MEDIUM, Graph.FONT_TIMES_BOLD, Graph.FONT_COURIER_MEDIUM or Graph.FONT_COURIER_BOLD |
| legend_font_colour | Colour | Font colour for the curve labels in the legend |
| legend_font_size | constant | Font size for the curve labels in the legend. Can take either Graph.FONT_SIZE_AUTO, Graph.FONT_SIZE_8, Graph.FONT_SIZE_10, Graph.FONT_SIZE_12, Graph.FONT_SIZE_14, Graph.FONT_SIZE_18 or Graph.FONT_SIZE_24 |
| legend_layout | constant | Defines the legend layout type. Can take Graph.LEGEND_COLUMN_LIST, Graph.LEGEND_AUTO, Graph.LEGEND_OFF or Graph.LEGEND_FLOATING |
| legend_prefix_format | constant | Format of the prefix that is being included in the curve label of the legend. Can take either Graph.PREFIX_MODEL_NUMBER, Graph.DIR, Graph.PREFIX_THF or Graph.PREFIX_USER_DEFINED |
| legend_show_prefix | constant | Include the prefix in the curve label of the legend. Can take either Graph.PREFIX_AUTO, Graph.PREFIX_ON or Graph.PREFIX_OFF |
| legend_show_user_lines | constant | Visibility of user lines when Graph.LEGEND_COLUMN_LIST is selected for legend layout. Can take either Graph.ON or Graph.OFF |
| legend_user_line_1 | string | User defined line 1 from the legend area |
| legend_user_line_1_size | constant | Font size for the user defined line 1. Can take either Graph.FONT_SIZE_AUTO, Graph.FONT_SIZE_8, Graph.FONT_SIZE_10, Graph.FONT_SIZE_12, Graph.FONT_SIZE_14, Graph.FONT_SIZE_18 or Graph.FONT_SIZE_24 |
| legend_user_line_2 | string | User defined line 2 from the legend area |
| legend_user_line_2_size | constant | Font size for the user defined line 2. Can take either Graph.FONT_SIZE_AUTO, Graph.FONT_SIZE_8, Graph.FONT_SIZE_10, Graph.FONT_SIZE_12, Graph.FONT_SIZE_14, Graph.FONT_SIZE_18 or Graph.FONT_SIZE_24 |
| legend_user_line_3 | string | User defined line 3 from the legend area |
| legend_user_line_3_size | constant | Font size for the user defined line 3. Can take either Graph.FONT_SIZE_AUTO, Graph.FONT_SIZE_8, Graph.FONT_SIZE_10, Graph.FONT_SIZE_12, Graph.FONT_SIZE_14, Graph.FONT_SIZE_18 or Graph.FONT_SIZE_24 |
| legend_user_line_4 | string | User defined line 4 from the legend area |
| legend_user_line_4_size | constant | Font size for the user defined line 4. Can take either Graph.FONT_SIZE_AUTO, Graph.FONT_SIZE_8, Graph.FONT_SIZE_10, Graph.FONT_SIZE_12, Graph.FONT_SIZE_14, Graph.FONT_SIZE_18 or Graph.FONT_SIZE_24 |
| legend_user_line_5 | string | User defined line 6 from the legend area |
| legend_user_line_5_size | constant | Font size for the user defined line 5. Can take either Graph.FONT_SIZE_AUTO, Graph.FONT_SIZE_8, Graph.FONT_SIZE_10, Graph.FONT_SIZE_12, Graph.FONT_SIZE_14, Graph.FONT_SIZE_18 or Graph.FONT_SIZE_24 |
| legend_user_line_6 | string | User defined line 6 from the legend area |
| legend_user_line_6_size | constant | Font size for the user defined line 6. Can take either Graph.FONT_SIZE_AUTO, Graph.FONT_SIZE_8, Graph.FONT_SIZE_10, Graph.FONT_SIZE_12, Graph.FONT_SIZE_14, Graph.FONT_SIZE_18 or Graph.FONT_SIZE_24 |
| legend_user_lines_colour | Colour | Font colour for the user defined lines in the legend |
| legend_user_lines_font | constant | Font for the user defined lines in the legend. Can take either Graph.FONT_DEFAULT, Graph.FONT_HELVETICA_MEDIUM, Graph.FONT_HELVETICA_BOLD, Graph.FONT_TIMES_MEDIUM, Graph.FONT_TIMES_BOLD, Graph.FONT_COURIER_MEDIUM or Graph.FONT_COURIER_BOLD |
| num_legend_columns | constant | Number of columns of curve labels in legends. Can take Graph.LEGEND_1_COLUMN, Graph.LEGEND_2_COLUMN or Graph.LEGEND_3_COLUMN |
| show_title | string | Shows graph title. Can take either Graph.ON or Graph.OFF |
| show_xlabel | constant | Shows graph x-axis label. Can take either Graph.ON or Graph.OFF |
| show_y2axis | constant | Shows graph second y-axis. Can take either Graph.ON or Graph.OFF. (Note, Curve property y_axis must be set to Curve.Y2_AXIS for the curve to be plotted on the second y-axis.) |
| show_y2label | constant | Shows graph second y-axis label. Can take either Graph.ON or Graph.OFF |
| show_ylabel | constant | Shows graph y-axis label. Can take either Graph.ON or Graph.OFF |
| title | string | Graph title |
| x_axis_type | constant | Defines x-axis type i.e. linear or logarithmic. Can take either Graph.AXIS_LINEAR or Graph.AXIS_LOG |
| x_unit_colour | Colour | Colour of the x-axis units |
| x_unit_decimals | integer | Defines the number decimals in the x-axis units. |
| x_unit_font | constant | Font for the x-axis units. Can take either Graph.FONT_DEFAULT, Graph.FONT_HELVETICA_MEDIUM, Graph.FONT_HELVETICA_BOLD, Graph.FONT_TIMES_MEDIUM, Graph.FONT_TIMES_BOLD, Graph.FONT_COURIER_MEDIUM or Graph.FONT_COURIER_BOLD |
| x_unit_format | constant | Defines the format for the x-axis units. Can take either Graph.AXIS_UNITS_AUTO, Graph.AXIS_UNITS_SCIENTIFIC or Graph.AXIS_UNITS_GENERAL |
| x_unit_size | constant | Font size for the x-axis units. Can take either Graph.FONT_SIZE_AUTO, Graph.FONT_SIZE_8, Graph.FONT_SIZE_10, Graph.FONT_SIZE_12, Graph.FONT_SIZE_14, Graph.FONT_SIZE_18 or Graph.FONT_SIZE_24 |
| xlabel | string | Label for x-axis |
| xlabel_colour | Colour | Colour of the x-axis label |
| xlabel_font | constant | Font for the x-axis label. Can take either Graph.FONT_DEFAULT, Graph.FONT_HELVETICA_MEDIUM, Graph.FONT_HELVETICA_BOLD, Graph.FONT_TIMES_MEDIUM, Graph.FONT_TIMES_BOLD, Graph.FONT_COURIER_MEDIUM or Graph.FONT_COURIER_BOLD |
| xlabel_size | constant | Font size for the x-axis label. Can take either Graph.FONT_SIZE_AUTO, Graph.FONT_SIZE_8, Graph.FONT_SIZE_10, Graph.FONT_SIZE_12, Graph.FONT_SIZE_14, Graph.FONT_SIZE_18 or Graph.FONT_SIZE_24 |
| xmax | real | Maximum value of x-axis range |
| xmin | real | Minimum value of the x-axis range |
| y2_axis_type | constant | Defines second y-axis type i.e. linear or logarithmic. Can take either Graph.AXIS_LINEAR or Graph.AXIS_LOG |
| y2_unit_colour | Colour | Colour of the second y-axis units |
| y2_unit_decimals | integer | Defines the number decimals in the second y-axis units. |
| y2_unit_font | constant | Font for the second y-axis label. Can take either Graph.FONT_DEFAULT, Graph.FONT_HELVETICA_MEDIUM, Graph.FONT_HELVETICA_BOLD, Graph.FONT_TIMES_MEDIUM, Graph.FONT_TIMES_BOLD, Graph.FONT_COURIER_MEDIUM or Graph.FONT_COURIER_BOLD |
| y2_unit_format | constant | Defines the format for the second y-axis units. Can take either Graph.AXIS_UNITS_AUTO, Graph.AXIS_UNITS_SCIENTIFIC or Graph.AXIS_UNITS_GENERAL |
| y2_unit_size | constant | Font size for the second y-axis units. Can take either Graph.FONT_SIZE_AUTO, Graph.FONT_SIZE_8, Graph.FONT_SIZE_10, Graph.FONT_SIZE_12, Graph.FONT_SIZE_14, Graph.FONT_SIZE_18 or Graph.FONT_SIZE_24 |
| y2label | string | Label for second y-axis |
| y2label_colour | Colour | Colour of the second y-axis label |
| y2label_font | constant | Font for the second y-axis label. Can take either Graph.FONT_DEFAULT, Graph.FONT_HELVETICA_MEDIUM, Graph.FONT_HELVETICA_BOLD, Graph.FONT_TIMES_MEDIUM, Graph.FONT_TIMES_BOLD, Graph.FONT_COURIER_MEDIUM or Graph.FONT_COURIER_BOLD |
| y2label_size | constant | Font size for the second y-axis label. Can take either Graph.FONT_SIZE_AUTO, Graph.FONT_SIZE_8, Graph.FONT_SIZE_10, Graph.FONT_SIZE_12, Graph.FONT_SIZE_14, Graph.FONT_SIZE_18 or Graph.FONT_SIZE_24 |
| y2max | real | Maximum value of the second y-axis range |
| y2min | real | Minimum value of the second y-axis range |
| y_axis_type | constant | Defines y-axis type i.e. linear or logarithmic. Can take either Graph.AXIS_LINEAR or Graph.AXIS_LOG |
| y_unit_colour | Colour | Colour of the y-axis units |
| y_unit_decimals | integer | The number decimals in the y-axis units. |
| y_unit_font | constant | Font for the y-axis units. Can take either Graph.FONT_DEFAULT, Graph.FONT_HELVETICA_MEDIUM, Graph.FONT_HELVETICA_BOLD, Graph.FONT_TIMES_MEDIUM, Graph.FONT_TIMES_BOLD, Graph.FONT_COURIER_MEDIUM or Graph.FONT_COURIER_BOLD |
| y_unit_format | constant | Defines the format for the y-axis units. Can take either Graph.AXIS_UNITS_AUTO, Graph.AXIS_UNITS_SCIENTIFIC or Graph.AXIS_UNITS_GENERAL |
| y_unit_size | constant | Font size for the y-axis units. Can take either Graph.FONT_SIZE_AUTO, Graph.FONT_SIZE_8, Graph.FONT_SIZE_10, Graph.FONT_SIZE_12, Graph.FONT_SIZE_14, Graph.FONT_SIZE_18 or Graph.FONT_SIZE_24 |
| ylabel | string | Label for y-axis |
| ylabel_colour | Colour | Colour of the y-axis label |
| ylabel_font | constant | Font for the y-axis label. Can take either Graph.FONT_DEFAULT, Graph.FONT_HELVETICA_MEDIUM, Graph.FONT_HELVETICA_BOLD, Graph.FONT_TIMES_MEDIUM, Graph.FONT_TIMES_BOLD, Graph.FONT_COURIER_MEDIUM or Graph.FONT_COURIER_BOLD |
| ylabel_size | constant | Font size for the y-axis label. Can take either Graph.FONT_SIZE_AUTO, Graph.FONT_SIZE_8, Graph.FONT_SIZE_10, Graph.FONT_SIZE_12, Graph.FONT_SIZE_14, Graph.FONT_SIZE_18 or Graph.FONT_SIZE_24 |
| ymax | real | Maximum value of y-axis range |
| ymin | real | Minimum value of the y-axis range |
Detailed DescriptionThe Graph class contains information on the number of graphs. See the documentation below for more details. |
Constructornew Graph(index (optional)[integer])DescriptionCreate a new Graph. |
Graph index to copy initial display and axis settings from (optional). If not defined then the display and axis settings will be copied from those defined in the preference file.
ReturnsGraph object Return typeGraph |
ExampleTo create a new graph and copy all of the setting from graph 2 var l = new Graph(2);
|
Details of functionsAddCurveID(Curve ID[integer], redraw (optional)[boolean])DescriptionAdds a curve to the graph. |
ID of the curve to add.
If this argument is false then the graph will not be redrawn after the curve is added. This is to be used if a large number of curves are to be added to a graph, so as to avoid the same curves being drawn multiple times. No argument or true will trigger a redraw after the curve is added.
ReturnsReturns true if the curve is successfully added to the graph else it would return false Return typeBoolean |
ExampleTo add a curve with id (n) to the graph (g): g.AddCurveID(n);
|
ID of the curve to add.
If this argument is 1 then the graph will not be redrawn after the curve is added. This is to be used if a large number of curves are to be added to a graph, so as to avoid the same curves being drawn multiple times. No argument or 0 will trigger a redraw after the curve is added.
ReturnsReturns true if the curve is successfully added to the graph else it would return false Return typeBoolean |
ExampleTo add a curve with id (n) to the graph (g): g.AddCurveID(n);
|
AddToPage(Page number[integer])DescriptionAdds the graph to the page. |
Page number for which to add the graph to.
ReturnsReturns true if the graph is successfully added to the page else it would return false Return typeBoolean |
ExampleTo add a graph (g) to page id (n): g.AddToPage(n);
|
Delete()DescriptionDeletes the graph |
No arguments
ReturnsNo return value |
ExampleDeletes the graph (g) g.Delete();
|
DeleteFromID(ID[integer]) [static]DescriptionDeletes a graph |
ID of graph to delete
ReturnsNo return value |
ExampleTo delete the graph n Graph.DeleteFromID(n); Maximum number of graphs in T/HIS is 32 |
GetAllCurveIDs()DescriptionReturns the IDs of the curves present in the graph in an array. |
No arguments
ReturnsArray of curve IDs Return typearray |
ExampleTo get the array of all the curve ids present in a graph (g): var num = g.GetAllCurveIDs();
|
GetAllPageIDs()DescriptionReturns all the pages containing the graph. |
No arguments
ReturnsArray of page IDs Return typearray |
ExampleTo get the list of all page ids containing the graph (g): var pages_ids = g.GetAllPageIDs();
|
GetFromID(ID[integer]) [static]DescriptionReturns the graph object for a given graph id. |
ID of graph to return the graph for
ReturnsGraph object or NULL if graph does not exists Return typeGraph |
ExampleTo get the graph n var num = Graph.GetFromID(n); Maximum number of graphs in T/HIS is 32 |
GetNumCurves()DescriptionReturns number curves present in the graph. |
No arguments
ReturnsNumber of curves present in the graph. Return typeNumber |
ExampleTo find number of curves in a graph (g): var num = g.GetNumCurves();
|
Lock(Lock type[integer])DescriptionLocks the blanking status of either blanked curves, unblanked curves or all curves on the graph. |
No argument or 0 to lock blanked curves, -1 to unlock blanked curves, -2 to unfreeze all visible curves
ReturnsNo return value |
ExampleTo lock all blanked curves on graph g: g.Lock();
|
RemoveCurveID(ID[integer])DescriptionRemoves a curve from the graph. |
ID of the curve to be removed
ReturnsReturns true if the curve is successfully removed from the graph else it would return false Return typeBoolean |
ExampleTo remove a curve with id (n) from the graph (g): g.RemoveCurveID(n);
|
RemoveFromPage(ID[integer])DescriptionRemoves the graph from a page. |
ID of the page from which the graph is to be removed
ReturnsReturns true if the graph is successfully removed from the page else it would return false Return typeBoolean |
ExampleTo remove the graph (g) from page with id (n): g.RemoveFromPage(n);
|
Total() [static]DescriptionReturns the total number of graphs. |
No arguments
Returnsinteger Return typeNumber |
ExampleTo find how many graphs there are in T/HIS: var num = Graph.Total();
|