public class ChartingModule extends AbstractScriptModule
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MODULE_NAME |
| Constructor and Description |
|---|
ChartingModule() |
| Modifier and Type | Method and Description |
|---|---|
org.eclipse.nebula.visualization.xygraph.figures.Annotation |
addMarker(java.lang.String text,
java.lang.Double xPosition,
java.lang.Double yPosition)
Add a marker to the chart.
|
void |
clear()
Clears the active chart.
|
void |
exportGraph(java.lang.Object location,
boolean overwrite)
Export the current figure as png file.
|
Chart |
figure(java.lang.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(java.lang.String seriesName)
Deletes a given 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.
|
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(java.lang.String chartTitle)
Sets the title of the active chart.
|
org.eclipse.nebula.visualization.xygraph.figures.Axis |
setXLabel(java.lang.String label)
Set X axis name.
|
org.eclipse.nebula.visualization.xygraph.figures.Axis |
setYLabel(java.lang.String label)
Set Y axis name.
|
void |
showGrid(boolean showGrid)
Activates or deactivates drawing of a background grid.
|
getScriptEngine, initializepublic static final java.lang.String MODULE_NAME
public Chart figure(@ScriptParameter(defaultValue="org.eclipse.ease.modules.ScriptParameter.null") java.lang.String figureId) throws java.lang.Throwable
figureId - name of the figure to be createdjava.lang.Throwable - when the view could not be initializedpublic org.eclipse.nebula.visualization.xygraph.figures.Trace series(@ScriptParameter(defaultValue="org.eclipse.ease.modules.ScriptParameter.null") java.lang.String seriesName, @ScriptParameter(defaultValue="") java.lang.String format) throws java.lang.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 |
java.lang.Throwable - if the series could not be initializedpublic org.eclipse.nebula.visualization.xygraph.figures.Trace plotPoint(double x,
double y)
throws java.lang.Throwable
x - x coordinate of this pointy - y coordinate of this pointjava.lang.Throwable - when the view could not be initializedpublic org.eclipse.nebula.visualization.xygraph.figures.Trace plot(double[] x,
double[] y)
throws java.lang.Throwable
x - array of x coordinatesy - array of y coordinatesjava.lang.Throwable - when the view could not be initializedpublic org.eclipse.nebula.visualization.xygraph.figures.XYGraph setPlotTitle(java.lang.String chartTitle)
chartTitle - title to be setXYGraph object or null if there is no active graphpublic org.eclipse.nebula.visualization.xygraph.figures.Axis setXLabel(java.lang.String label)
label - label to be used for X axisAxis object or null if there is no active graphpublic org.eclipse.nebula.visualization.xygraph.figures.Axis setYLabel(java.lang.String label)
label - label to be used for Y axisAxis object or null if there is no active graphpublic void setAxisRange(double[] xRange,
double[] yRange)
xRange - Range from x Axis to be set, format is [xmin, xmax]yRange - Range from Y Axis to be set, format is [ymin, ymax]public void showGrid(boolean showGrid)
showGrid - if true a grid will be displayedpublic void setAutoScale(boolean performAutoScale)
performAutoScale - if true auto scaling will be enabledpublic void clear()
public void exportGraph(@ScriptParameter(defaultValue="org.eclipse.ease.modules.ScriptParameter.null") java.lang.Object location, @ScriptParameter(defaultValue="false") boolean overwrite) throws java.lang.Throwable
location - where to store image to. Accepts strings, IFile and File instancesoverwrite - Overwrite flag, if true file will be overwritten without questionjava.lang.Throwable - when the view could not be initializedpublic void removeSeries(java.lang.String seriesName)
throws java.lang.Throwable
seriesName - name of series to be deletedjava.lang.Throwable - when the view could not be initializedpublic org.eclipse.nebula.visualization.xygraph.figures.Annotation addMarker(java.lang.String text,
@ScriptParameter(defaultValue="org.eclipse.ease.modules.ScriptParameter.null")
java.lang.Double xPosition,
@ScriptParameter(defaultValue="org.eclipse.ease.modules.ScriptParameter.null")
java.lang.Double yPosition)
text - text to displayxPosition - if set, this will be the X position the marker points toyPosition - if set, this will be the Y position the marker points to