Graph

A 2D graph where results can be plotted.

Example

app = pf.GetApplication()
app:NewProject()
app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/startup.fek]])

    -- Add a Cartesian graph and a trace 
    
graph = app.CartesianGraphs:Add()
excitation = app.Models["startup"].Configurations[1].Excitations[1]
excitationTrace = graph.Traces:Add(excitation)

    -- Change properties of the graph 

graph.BackColour = pf.Enums.ColourEnum.LightGrey
graph.Grid.Minor.Visible = true
graph.Grid.Border.Weight = 2

Inheritance

The Graph object is derived from the Window object.

The following objects are derived (specialisations) from the Graph object:

Property List

BackColour
The background colour of the graph. (Read/Write Colour)
Footer
The graph footer properties. (Read only TextBox)
GreyscaleEnabled
Set the graph's colour scheme to greyscale. (Read/Write boolean)
Height
The height of the window. (Read only number)
Legend
The graph legend properties. (Read only GraphLegend)
Title
The graph title properties. (Read only TextBox)
Width
The width of the window. (Read only number)
WindowActive
True if this window is the active window. (Read only boolean)
WindowTitle
The title of the window. (Read/Write string)
XPosition
The X position of the window. (Read only number)
YPosition
The Y position of the window. (Read only number)

Collection List

Arrows
The collection of 2D arrows on the graph. (ResultArrowCollection of ResultArrow.)
Shapes
The collection of 2D shapes on the graph. (ResultTextBoxCollection of ResultTextBox.)
Traces
The collection of 2D traces on the graph. (ResultTraceCollection of ResultTrace.)

Method List

BlockGraphRedraws ()
Disables graph redraws for performance purposes. When all the changes to the graph are complete, call UnblockGraphRedraws to re-enable graph updates.
Close ()
Close the window.
Duplicate ()
Duplicate the 2D graph. (Returns a Graph object.)
ExportImage (filename string, fileformat string)
Export the window image at its same size to a specified file.
ExportImage (filename string, fileformat string, imagewidth number, imageheight number)
Export the window image at the given size to a specified file.
ExportTraces (filename string, samples number)
Export the graph traces to the specified tab separated file.
Maximise ()
Maximise the window.
Minimise ()
Minimise the window.
Restore ()
Restore the window.
SetPosition (xposition number, yposition number)
Sets the view position. Note that the view is restored when this function is called.
SetSize (imagewidth number, imageheight number)
Sets the view size. Note that the view is restored when this function is called.
Show ()
Shows the view.
UnblockGraphRedraws ()
Enables graph redraws. This method is used in conjunction with BlockGraphRedraws for performance purposes. The graph is redrawn when this method is called and normals redraws will occur on changes.
ZoomToExtents ()
Zoom the content of the window to its extent.

Property Details

BackColour
The background colour of the graph.
Type
Colour
Access
Read/Write
Footer
The graph footer properties.
Type
TextBox
Access
Read only
GreyscaleEnabled
Set the graph's colour scheme to greyscale.
Type
boolean
Access
Read/Write
Height
The height of the window.
Type
number
Access
Read only
Legend
The graph legend properties.
Type
GraphLegend
Access
Read only
Title
The graph title properties.
Type
TextBox
Access
Read only
Width
The width of the window.
Type
number
Access
Read only
WindowActive
True if this window is the active window.
Type
boolean
Access
Read only
WindowTitle
The title of the window.
Type
string
Access
Read/Write
XPosition
The X position of the window.
Type
number
Access
Read only
YPosition
The Y position of the window.
Type
number
Access
Read only

Collection Details

Arrows
The collection of 2D arrows on the graph.
Type
ResultArrowCollection
Shapes
The collection of 2D shapes on the graph.
Type
ResultTextBoxCollection
Traces
The collection of 2D traces on the graph.
Type
ResultTraceCollection

Method Details

BlockGraphRedraws ()
Disables graph redraws for performance purposes. When all the changes to the graph are complete, call UnblockGraphRedraws to re-enable graph updates.
Close ()
Close the window.
Duplicate ()
Duplicate the 2D graph.
Return
Graph
The duplicated 2D graph.
ExportImage (filename string, fileformat string)
Export the window image at its same size to a specified file.
Input Parameters
filename(string)
The name of the image file without its extension.
fileformat(string)
The image file format, e.g. jpg, png, pdf, etc.
ExportImage (filename string, fileformat string, imagewidth number, imageheight number)
Export the window image at the given size to a specified file.
Input Parameters
filename(string)
The name of the image file without its extension.
fileformat(string)
The image file format, e.g. jpg, png, pdf, etc.
imagewidth(number)
The export width in pixels.
imageheight(number)
The export height in pixels.
ExportTraces (filename string, samples number)
Export the graph traces to the specified tab separated file.
Input Parameters
filename(string)
The name of the exported data file without its extension.
samples(number)
The number of samples for continuous data. This value will be ignored if the first trace on the graph is discrete.
Maximise ()
Maximise the window.
Minimise ()
Minimise the window.
Restore ()
Restore the window.
SetPosition (xposition number, yposition number)
Sets the view position. Note that the view is restored when this function is called.
Input Parameters
xposition(number)
The view X position.
yposition(number)
The view Y position.
SetSize (imagewidth number, imageheight number)
Sets the view size. Note that the view is restored when this function is called.
Input Parameters
imagewidth(number)
The view width in pixels.
imageheight(number)
The view height in pixels.
Show ()
Shows the view.
UnblockGraphRedraws ()
Enables graph redraws. This method is used in conjunction with BlockGraphRedraws for performance purposes. The graph is redrawn when this method is called and normals redraws will occur on changes.
ZoomToExtents ()
Zoom the content of the window to its extent.