public class ChartingModule extends AbstractScriptModule
| Modifier and Type | Field and Description |
|---|---|
static String |
MODULE_NAME |
| Constructor and Description |
|---|
ChartingModule() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the active chart.
|
void |
exportGraph(Object location,
boolean overwrite)
Export the current figure as png file.
|
Chart |
figure(String figureId)
Opens a new view with an empty figure.
|
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).
|
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).
|
void |
removeSeries(String seriesName)
Deletes a given series.
|
org.eclipse.nebula.visualization.xygraph.figures.Trace |
series(String seriesName,
String format)
Series will be created with the name seriesName.
|
void |
setAutoScale(boolean performAutoScale)
Activates or deactivates auto scaling whenever the cart is updated.
|
void |
setAxisRange(double[] xRange,
double[] yRange)
Set lower and upper limit of the X axis and the Y axis.
|
org.eclipse.nebula.visualization.xygraph.figures.XYGraph |
setPlotTitle(String chartTitle)
Sets the title of the active chart.
|
org.eclipse.nebula.visualization.xygraph.figures.Axis |
setXLabel(String label)
Set X axis name.
|
org.eclipse.nebula.visualization.xygraph.figures.Axis |
setYLabel(String label)
Set Y axis name.
|
void |
showGrid(boolean showGrid)
Activates or deactivates drawing of a background grid.
|
getScriptEngine, initializepublic static final String MODULE_NAME
public Chart figure(@ScriptParameter(defaultValue="org.eclipse.ease.modules.ScriptParameter.null") String figureId) throws Throwable
figureId - name of the figure to be createdThrowable - when the view could not be initializedpublic org.eclipse.nebula.visualization.xygraph.figures.Trace series(@ScriptParameter(defaultValue="org.eclipse.ease.modules.ScriptParameter.null") String seriesName, @ScriptParameter(defaultValue="") String format) throws Throwable
seriesName - Name of this series. Default is null if no seriesName is given, in that case the name is "Series id" as explained aboveformat - 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 |
Throwable - if the series could not be initializedpublic org.eclipse.nebula.visualization.xygraph.figures.Trace plotPoint(double x,
double y)
throws Throwable
x - x coordinate of this pointy - y coordinate of this pointThrowablepublic org.eclipse.nebula.visualization.xygraph.figures.Trace plot(double[] x,
double[] y)
throws Throwable
x - array of x coordinatesy - array of y coordinatesThrowablepublic org.eclipse.nebula.visualization.xygraph.figures.XYGraph setPlotTitle(String chartTitle) throws PartInitException
chartTitle - title to be setXYGraph object or null if there is no active graphPartInitExceptionpublic org.eclipse.nebula.visualization.xygraph.figures.Axis setXLabel(String label) throws PartInitException
label - label to be used for X axisAxis object or null if there is no active graphPartInitExceptionpublic org.eclipse.nebula.visualization.xygraph.figures.Axis setYLabel(String label) throws PartInitException
label - label to be used for Y axisAxis object or null if there is no active graphPartInitExceptionpublic void setAxisRange(double[] xRange,
double[] yRange)
throws Exception
xRange - Range from x Axis to be set, format is [xmin, xmax]yRange - Range from Y Axis to be set, format is [ymin, ymax]Exceptionpublic void showGrid(boolean showGrid)
throws PartInitException
showGrid - if true a grid will be displayedPartInitExceptionpublic void setAutoScale(boolean performAutoScale)
throws PartInitException
performAutoScale - if true auto scaling will be enabledPartInitExceptionpublic void clear()
throws PartInitException
PartInitExceptionpublic void exportGraph(@ScriptParameter(defaultValue="org.eclipse.ease.modules.ScriptParameter.null") Object location, @ScriptParameter(defaultValue="false") boolean overwrite) throws Throwable