# Charting Module

### Dependencies

This module depends on following other modules which will automatically be loaded.

- Resources module

## Method Overview

Method | Description
--- | ---
axis() | Alias for setAxisRange.
clear() | Clears the active chart.
exportGraph() | Export the current figure as png file.
figure() | Opens a new view with an empty figure.
plot() | Plot array of points (x[],y[]) on the last series that is set with method series(seriesName, format).
plotPoint() | Add (x,y) point to the last Series that is set with method series(seriesName,format).
removeSeries() | Deletes a given series.
series() | Series will be created with the name seriesName.
setAutoScale() | Activates or deactivates auto scaling whenever the cart is updated.
setAxisRange() | Set lower and upper limit of the X axis and the Y axis.
setPlotTitle() | Sets the title of the active chart.
setXLabel() | Set X axis name.
setYLabel() | Set Y axis name.
showGrid() | Activates or deactivates drawing of a background grid.
title() | Alias for setPlotTitle.
xlabel() | Alias for setXLabel.
ylabel() | Alias for setYLabel.

## Methods

### clear

void clear()

Clears the active chart.

### exportGraph

void exportGraph([java.lang.Object location], [boolean overwrite])

Export the current figure as png file. When no location is provided, a popup dialog will ask the user for the target location.

Parameter | Type | Description
--- | --- | ---
location | java.lang.Object | where to store image to. Accepts strings, IFile and File instances Optional: defaults to <null>.
overwrite | boolean | Overwrite flag, if `true` file will be overwritten without question Optional: defaults to <false>.

### figure

org.eclipse.ease.modules.charting.views.Chart figure([java.lang.String figureId])

Opens a new view with an empty figure. figureId is used as a view and chart title. If a view with the same figureId already exists, it will be activated. The last activated figure will be used for all further commands of this modules.

Parameter | Type | Description
--- | --- | ---
figureId | java.lang.String | name of the figure to be created Optional: defaults to <null>.

Returns:org.eclipse.ease.modules.charting.views.Chart ... new or activated chart

### plot

org.eclipse.nebula.visualization.xygraph.figures.Trace plot(double x, double y)

Plot array of points (x[],y[]) on the last series that is set with method series(seriesName, format). If there is no active Figure and Series then both will be created and activated.

Parameter | Type | Description
--- | --- | ---
x | double | array of x coordinates
y | double | array of y coordinates

Returns:org.eclipse.nebula.visualization.xygraph.figures.Trace ... series as Trace type to set different properties for this series

### plotPoint

org.eclipse.nebula.visualization.xygraph.figures.Trace plotPoint(double x, double y)

Add (x,y) point to the last Series that is set with method series(seriesName,format). If there is no active figure and series then both will be created and activated.

Parameter | Type | Description
--- | --- | ---
x | double | x coordinate of this point
y | double | y coordinate of this point

Returns:org.eclipse.nebula.visualization.xygraph.figures.Trace ... series as Trace type to set different properties for this series

### removeSeries

void removeSeries(java.lang.String seriesName)

Deletes a given series. If the series does not exists this method does nothing.

Parameter | Type | Description
--- | --- | ---
seriesName | java.lang.String | name of series to be deleted

### series

org.eclipse.nebula.visualization.xygraph.figures.Trace series([java.lang.String seriesName], [java.lang.String format])

Series will be created with the name seriesName. If the name is not given then Series will have the name "Series id" where id is the current number of the Series Iterator. Series Iterator start at 1 and with every new Series is incremented by one. If Series is already created with seriesName then that series will be set as currently active Series and on that Series methods will be performed. If there is no active Figure then Figure will be created and activated.

Parameter | Type | Description
--- | --- | ---
seriesName | java.lang.String | Name of this series. Default is `null` if no seriesName is given, in that case the name is "Series id" as explained above Optional: defaults to <null>.

format

java.lang.String

default is "", if number is written inside format like "f#25" point size will be set(in this case 25), please write format correctly, if for example 2 colors will be written like "rg" then the last one will be taken, in this case g or green, so please set line style, point size, color and Marker Type only once. Used matlab syntax to define plot format:

Specifier | LineStyle
--- | ---
'`-`' | Solid line (default)
'`--`' | Dashed line
'`:`' | Dotted line
'`-.`' | Dash-dot line
'`#`' | No line

Specifier | Color
--- | ---
`r` | Red
`g` | Green
`b` | Blue
`c` | Cyan
`m` | Magenta
`y` | Yellow
`k` | Black
`w` | White

Specifier | Marker Type
--- | ---
'`+`' | Plus sign
'`o`' | Circle
'`p`' | Point
'`x`' | Cross
'`s`' | Square
'`f`' | Filled Square
'`d`' | Diamond
'`v`' | Downward-pointing triangle

Optional: defaults to <"">.

Returns:org.eclipse.nebula.visualization.xygraph.figures.Trace ... series as Trace type to set different properties for this series

### setAutoScale

void setAutoScale(boolean performAutoScale)

Activates or deactivates auto scaling whenever the cart is updated. An auto scale may also be triggered by double clicking right into the chart area.

Parameter | Type | Description
--- | --- | ---
performAutoScale | boolean | if `true` auto scaling will be enabled

### setAxisRange

void setAxisRange(double xRange, double yRange)

Set lower and upper limit of the X axis and the Y axis.

Alias: axis()

Parameter | Type | Description
--- | --- | ---
xRange | double | Range from x Axis to be set, format is [xmin, xmax]
yRange | double | Range from Y Axis to be set, format is [ymin, ymax]

### setPlotTitle

org.eclipse.nebula.visualization.xygraph.figures.XYGraph setPlotTitle(java.lang.String chartTitle)

Sets the title of the active chart.

Alias: title()

Parameter | Type | Description
--- | --- | ---
chartTitle | java.lang.String | title to be set

Returns:org.eclipse.nebula.visualization.xygraph.figures.XYGraph ... XYGraph object or `null` if there is no active graph

### setXLabel

org.eclipse.nebula.visualization.xygraph.figures.Axis setXLabel(java.lang.String label)

Set X axis name.

Alias: xlabel()

Parameter | Type | Description
--- | --- | ---
label | java.lang.String | label to be used for X axis

Returns:org.eclipse.nebula.visualization.xygraph.figures.Axis ... Axis object or `null` if there is no active graph

### setYLabel

org.eclipse.nebula.visualization.xygraph.figures.Axis setYLabel(java.lang.String label)

Set Y axis name.

Alias: ylabel()

Parameter | Type | Description
--- | --- | ---
label | java.lang.String | label to be used for Y axis

Returns:org.eclipse.nebula.visualization.xygraph.figures.Axis ... Axis object or `null` if there is no active graph

### showGrid

void showGrid(boolean showGrid)

Activates or deactivates drawing of a background grid.

Parameter | Type | Description
--- | --- | ---
showGrid | boolean | if `true` a grid will be displayed