# PolarGraph

A 2D Polar graph where results can be plotted.

## Example

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

-- Create a graph with a trace

-- Export an image

graph:ExportImage("temp_FarFieldGraph", "pdf")


## Inheritance

The PolarGraph object is derived from the Graph object.

## Property List

AngularAxis
The polar graph angular axis properties. (Read only AngularGraphAxis)
BackColour
The background colour of the graph. (Read/Write Colour)
Direction
The polar graph direction specified by the PolarGraphDirectionEnum, e.g. Clockwise and Anticlockwise. (Read/Write PolarGraphDirectionEnum)
Footer
The graph footer properties. (Read only TextBox)
GreyscaleEnabled
Set the graph's colour scheme to greyscale. (Read/Write boolean)
Grid
The polar graph grid properties. (Read only PolarGraphGrid)
Height
The height of the window. (Read only number)
Legend
The graph legend properties. (Read only GraphLegend)
Normalisation
Orientation
The polar graph orientation specified by the PolarGraphOrientationEnum, e.g. ZeroAtTop, ZeroAtRight, etc. (Read/Write PolarGraphOrientationEnum)
Title
The graph title properties. (Read only TextBox)
Type
The object type string. (Read only string)
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

AddChartImage (view View, posX number, posY number)
Add a 3D view image to this 2D Graph.
AddChartImageForTrace (trace ResultTrace, posX number, posY number)
AddChartImageFromFile (file string, posX number, posY number)
Add an image file to this 2D Graph.
Adds a math trace to the 2D graph. (Returns a MathTrace object.)
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.)
DuplicateAsCartesian ()
Creates a Cartesian graph with the same data as the polar graph. (Returns a CartesianGraph 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.
GetProperties ()
Returns a table of properties representing the state of the object. The properties table can be used with the SetProperties method to change multiple properties of the object in one step. (Returns a table object.)
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.
SetProperties (properties table)
Modifies the state of the object using the provided table of properties. This method is used to modify multiple properties of the object in a single step.
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

AngularAxis
The polar graph angular axis properties.
Type
AngularGraphAxis
Access
BackColour
The background colour of the graph.
Type
Colour
Access
Direction
The polar graph direction specified by the PolarGraphDirectionEnum, e.g. Clockwise and Anticlockwise.
Type
PolarGraphDirectionEnum
Access
Footer
The graph footer properties.
Type
TextBox
Access
GreyscaleEnabled
Set the graph's colour scheme to greyscale.
Type
boolean
Access
Grid
The polar graph grid properties.
Type
PolarGraphGrid
Access
Height
The height of the window.
Type
number
Access
Legend
The graph legend properties.
Type
GraphLegend
Access
Normalisation
The polar radial axis normalisation properties.
Type
Normalisation
Access
Orientation
The polar graph orientation specified by the PolarGraphOrientationEnum, e.g. ZeroAtTop, ZeroAtRight, etc.
Type
PolarGraphOrientationEnum
Access
The polar graph radial axis properties.
Type
Access
Title
The graph title properties.
Type
TextBox
Access
Type
The object type string.
Type
string
Access
Width
The width of the window.
Type
number
Access
WindowActive
True if this window is the active window.
Type
boolean
Access
WindowTitle
The title of the window.
Type
string
Access
XPosition
The X position of the window.
Type
number
Access
YPosition
The Y position of the window.
Type
number
Access

## 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

AddChartImage (view View, posX number, posY number)
Add a 3D view image to this 2D Graph.
Input Parameters
view(View)
The 3D view.
posX(number)
The x-position of the added chart image.
posY(number)
The y-position of the added chart image.
AddChartImageForTrace (trace ResultTrace, posX number, posY number)
Input Parameters
trace(ResultTrace)
The trace.
posX(number)
The x-position of the added chart image.
posY(number)
The y-position of the added chart image.
AddChartImageFromFile (file string, posX number, posY number)
Add an image file to this 2D Graph.
Input Parameters
file(string)
The file.
posX(number)
The x-position of the added chart image.
posY(number)
The y-position of the added chart image.
Adds a math trace to the 2D graph.
Return
MathTrace
The math trace.
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.
DuplicateAsCartesian ()
Creates a Cartesian graph with the same data as the polar graph.
Return
CartesianGraph
The copied Cartesian 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.
GetProperties ()
Returns a table of properties representing the state of the object. The properties table can be used with the SetProperties method to change multiple properties of the object in one step.
Return
table
A properties table.
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.
SetProperties (properties table)
Modifies the state of the object using the provided table of properties. This method is used to modify multiple properties of the object in a single step.
Input Parameters
properties(table)
A table of properties defining the new state of the object.
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.